mirror of
https://github.com/systemd/systemd
synced 2026-03-23 23:34:52 +01:00
Compare commits
3 Commits
8bf79f0553
...
a4d9c121cc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4d9c121cc | ||
|
|
0ddd5e547e | ||
|
|
7ecc424fbe |
@ -51,9 +51,11 @@ static inline void *mfree(void *memory) {
|
|||||||
|
|
||||||
#define free_and_replace(a, b) \
|
#define free_and_replace(a, b) \
|
||||||
({ \
|
({ \
|
||||||
free(a); \
|
typeof(a)* _a = &(a); \
|
||||||
(a) = (b); \
|
typeof(b)* _b = &(b); \
|
||||||
(b) = NULL; \
|
free(*_a); \
|
||||||
|
(*_a) = (*_b); \
|
||||||
|
(*_b) = NULL; \
|
||||||
0; \
|
0; \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -233,9 +233,11 @@ int fputstrv(FILE *f, char * const *l, const char *separator, bool *space);
|
|||||||
|
|
||||||
#define strv_free_and_replace(a, b) \
|
#define strv_free_and_replace(a, b) \
|
||||||
({ \
|
({ \
|
||||||
strv_free(a); \
|
char ***_a = &(a); \
|
||||||
(a) = (b); \
|
char ***_b = &(b); \
|
||||||
(b) = NULL; \
|
strv_free(*_a); \
|
||||||
|
(*_a) = (*_b); \
|
||||||
|
(*_b) = NULL; \
|
||||||
0; \
|
0; \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -416,8 +416,7 @@ int xdg_autostart_format_exec_start(
|
|||||||
if (!escaped)
|
if (!escaped)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
free_and_replace(exec_split[n], escaped);
|
free_and_replace(exec_split[n++], escaped);
|
||||||
n++;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -457,8 +456,7 @@ int xdg_autostart_format_exec_start(
|
|||||||
if (!quoted)
|
if (!quoted)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
free_and_replace(exec_split[n], quoted);
|
free_and_replace(exec_split[n++], quoted);
|
||||||
n++;
|
|
||||||
}
|
}
|
||||||
for (; exec_split[n]; n++)
|
for (; exec_split[n]; n++)
|
||||||
exec_split[n] = mfree(exec_split[n]);
|
exec_split[n] = mfree(exec_split[n]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user