mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
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: Kir Kolyshkin <kir@openvz.org> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
52ab139c2e
commit
5940e3d14c
1 changed files with 1 additions and 1 deletions
|
|
@ -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) \
|
||||
({ \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue