summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
authorChantry Xavier <shiningxc@gmail.com>2007-11-21 17:10:20 +0100
committerDan McGee <dan@archlinux.org>2007-11-25 14:00:38 -0600
commit8bee526d28eaad45e0e1e210cd523e157c71cfae (patch)
tree31231c33805c4f846564e40294111f0141a2f7ca /lib/libalpm/sync.c
parentf5d2150e9db9205a9f208d4144b6d0381f877ad3 (diff)
downloadpacman-8bee526d28eaad45e0e1e210cd523e157c71cfae.tar.xz
Fix a memleak in _alpm_sync_free.
An alpm_list_free call was missing. Also make use of alpm_list_free_inner in both _alpm_sync_free and _alpm_trans_free. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 16b1998d..f03a78be 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -74,11 +74,8 @@ void _alpm_sync_free(pmsyncpkg_t *sync)
/* TODO wow this is ugly */
if(sync->type == PM_SYNC_TYPE_REPLACE) {
- alpm_list_t *tmp;
- for(tmp = sync->data; tmp; tmp = alpm_list_next(tmp)) {
- _alpm_pkg_free(tmp->data);
- tmp->data = NULL;
- }
+ alpm_list_free_inner(sync->data, (alpm_list_fn_free)_alpm_pkg_free);
+ alpm_list_free(sync->data);
sync->data = NULL;
} else {
_alpm_pkg_free(sync->data);