Commit 5940e3d1 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

xfree(): simplify

Contrary to a popular opinion, there is no need to check
an argument for being non-NULL before calling free().

>From free(3) man page:

> > If ptr is NULL, no operation is performed.

Let's change xfree macro to be a synonym for free().
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 52ab139c
......@@ -20,7 +20,7 @@
#define xzalloc(size) __xalloc(calloc, size, 1, size)
#define xrealloc(p, size) __xalloc(realloc, size, p, size)
#define xfree(p) do { if (p) free(p); } while (0)
#define xfree(p) free(p)
#define xrealloc_safe(pptr, size) \
({ \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment