From 8d9ee923ec3860e3f1133a66a0dc94ce85644bb4 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Wed, 21 Nov 2007 19:51:46 +0100 Subject: Fix several memleaks, mostly related to errors handling. * The frontend calls alpm_trans_prepare(&data), and in case of errors, receive the missing dependencies / conflicts / etc in the data pointer. It apparently needs to free this structure totally with : alpm_list_free_inner(data, free) alpm_list_free(data) So I added alpm_list_free_inner(data, free) in pacman/{sync.c,remove.c,add,c} * in _alpm_sync_prepare, the deps and asked lists were not freed in case of errors (unresolvable conflicts). Besides the code for handling this case was duplicated. * in _alpm_remove_commit, free was used instead of alpm_list_free for newfiles. * newline fix in pacman/sync.c Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- lib/libalpm/remove.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/remove.c') diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 592cf39e..e1f19ec8 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -315,7 +315,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db) (pkg_count - alpm_list_count(targ) + 1)); position++; } - free(newfiles); + alpm_list_free(newfiles); } /* set progress to 100% after we finish unlinking files */ -- cgit v1.2.3-54-g00ecf