1
0
mirror of https://github.com/systemd/systemd synced 2026-03-24 07:44:52 +01:00

Compare commits

..

No commits in common. "a4d9c121cc011d3a4feeaa74f54a69de8c9b0b20" and "8bf79f05532162d19fe6ee211297cff81b4f9874" have entirely different histories.

3 changed files with 10 additions and 12 deletions

View File

@ -51,11 +51,9 @@ static inline void *mfree(void *memory) {
#define free_and_replace(a, b) \
({ \
typeof(a)* _a = &(a); \
typeof(b)* _b = &(b); \
free(*_a); \
(*_a) = (*_b); \
(*_b) = NULL; \
free(a); \
(a) = (b); \
(b) = NULL; \
0; \
})

View File

@ -233,11 +233,9 @@ int fputstrv(FILE *f, char * const *l, const char *separator, bool *space);
#define strv_free_and_replace(a, b) \
({ \
char ***_a = &(a); \
char ***_b = &(b); \
strv_free(*_a); \
(*_a) = (*_b); \
(*_b) = NULL; \
strv_free(a); \
(a) = (b); \
(b) = NULL; \
0; \
})

View File

@ -416,7 +416,8 @@ int xdg_autostart_format_exec_start(
if (!escaped)
return log_oom();
free_and_replace(exec_split[n++], escaped);
free_and_replace(exec_split[n], escaped);
n++;
continue;
}
@ -456,7 +457,8 @@ int xdg_autostart_format_exec_start(
if (!quoted)
return log_oom();
free_and_replace(exec_split[n++], quoted);
free_and_replace(exec_split[n], quoted);
n++;
}
for (; exec_split[n]; n++)
exec_split[n] = mfree(exec_split[n]);