1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

Remove unnecessary NULL check in FREE() macro

free() is designed to do nothing if it is passed a NULL pointer, so there is
no need to check for it on our end. Change/fix the macro.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2008-04-19 12:51:28 -05:00
parent bf84c23266
commit 64e1dd64a4

View File

@ -47,7 +47,7 @@
/* This strdup macro is NULL safe- copying NULL will yield NULL */
#define STRDUP(r, s, action) do { if(s != NULL) { r = strdup(s); if(r == NULL) { ALLOC_FAIL(strlen(s)); action; } } else { r = NULL; } } while(0)
#define FREE(p) do { if(p) { free(p); p = NULL; } } while(0)
#define FREE(p) do { free(p); p = NULL; } while(0)
#define ASSERT(cond, action) do { if(!(cond)) { action; } } while(0)