summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-04-19 12:51:28 -0500
committerDan McGee <dan@archlinux.org>2008-04-19 15:59:40 -0500
commit64e1dd64a4512a5faa34e6007e64314569593522 (patch)
tree00aa88e97f65bf36622bb8566b3a11aaeba4da20 /lib
parentbf84c232664fdce4861a2b94ce895c2b160b355a (diff)
downloadpacman-64e1dd64a4512a5faa34e6007e64314569593522.tar.xz
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/util.h2
1 files changed, 1 insertions, 1 deletions
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)