mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 17:51:22 +03:00
alloc-util: drop double eval from free_and_replace()
Inspired by: 2744c7bb01
This commit is contained in:
parent
7925d693a7
commit
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; \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user