summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/list.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-02-22 21:49:33 +0100
committerAurelien Foret <aurelien@archlinux.org>2006-02-22 21:49:33 +0100
commit16ff7cfa8ef2d50c97d79357c2b2c1fdc2bc241b (patch)
treed259cc5a0de95d478c3a21df549dbd90880147cd /lib/libalpm/list.c
parent78ffd98701b64bff74fc530db91ffc7e8768989a (diff)
downloadpacman-16ff7cfa8ef2d50c97d79357c2b2c1fdc2bc241b.tar.gz
pacman-16ff7cfa8ef2d50c97d79357c2b2c1fdc2bc241b.tar.xz
improved _alpm_list_free handling
Diffstat (limited to 'lib/libalpm/list.c')
-rw-r--r--lib/libalpm/list.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libalpm/list.c b/lib/libalpm/list.c
index 632ee2a3..0e1c9426 100644
--- a/lib/libalpm/list.c
+++ b/lib/libalpm/list.c
@@ -42,13 +42,15 @@ PMList *_alpm_list_new()
return(list);
}
-void _alpm_list_free(PMList *list)
+void _alpm_list_free(PMList *list, _alpm_fn_free fn)
{
PMList *ptr, *it = list;
while(it) {
ptr = it->next;
- free(it->data);
+ if(fn) {
+ fn(it->data);
+ }
free(it);
it = ptr;
}