alloc-util: drop double eval from free_and_replace()

Inspired by: 2744c7bb01
This commit is contained in:
Lennart Poettering
2021-07-29 21:12:58 +02:00
parent 7925d693a7
commit 7ecc424fbe
2 changed files with 10 additions and 6 deletions
+5 -3
View File
@@ -51,9 +51,11 @@ static inline void *mfree(void *memory) {
#define free_and_replace(a, b) \
({ \
free(a); \
(a) = (b); \
(b) = NULL; \
typeof(a)* _a = &(a); \
typeof(b)* _b = &(b); \
free(*_a); \
(*_a) = (*_b); \
(*_b) = NULL; \
0; \
})