index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Aaron Griffin <aaron@archlinux.org> | 2006-10-31 06:39:59 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-10-31 06:39:59 +0000 |
commit | af2fb3324a925af6caa9d53aacac92173fc47885 (patch) | |
tree | b7abb647d27db75a1d937eea24cd5eccac6e5db8 /lib/libalpm/list.c | |
parent | 78c0badc9b3629c5156d4bd0733a3e9a1e4e92c6 (diff) |
-rw-r--r-- | lib/libalpm/list.c | 7 |
diff --git a/lib/libalpm/list.c b/lib/libalpm/list.c index be41a462..0f48030b 100644 --- a/lib/libalpm/list.c +++ b/lib/libalpm/list.c @@ -26,6 +26,7 @@ #include <assert.h> /* pacman */ #include "list.h" +#include "util.h" pmlist_t *_alpm_list_new() { @@ -48,10 +49,10 @@ void _alpm_list_free(pmlist_t *list, _alpm_fn_free fn) while(it) { ptr = it->next; - if(fn) { + if(fn && it->data) { fn(it->data); } - free(it); + FREE(it); it = ptr; } } @@ -180,7 +181,7 @@ pmlist_t *_alpm_list_remove(pmlist_t *haystack, void *needle, _alpm_fn_cmp fn, v *data = i->data; } i->data = NULL; - free(i); + FREE(i); } return(haystack); |