mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
util: More traditional xfree macro
Using do { } while (0) for statemets macro like this is a good practice. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -242,7 +242,7 @@ int do_open_proc(pid_t pid, int flags, const char *fmt, ...);
|
||||
#define xzalloc(size) __xalloc(calloc, size, 1, size)
|
||||
#define xrealloc(p, size) __xalloc(realloc, size, p, size)
|
||||
|
||||
#define xfree(p) if (p) free(p)
|
||||
#define xfree(p) do { if (p) free(p); } while (0)
|
||||
|
||||
#define xrealloc_safe(pptr, size) \
|
||||
({ \
|
||||
|
Reference in New Issue
Block a user