2
0
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:
Pavel Emelyanov
2012-07-11 14:45:08 +04:00
parent ab59e7d3a5
commit c69d18eada

View File

@@ -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) \
({ \