From 64e1dd64a4512a5faa34e6007e64314569593522 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 19 Apr 2008 12:51:28 -0500 Subject: 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 --- lib/libalpm/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/util.h') diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index 74b4f981..6c7a05e9 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -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) -- cgit v1.2.3-24-g4f1b