From 5f591637540dab91bc84d1135b7bd71c862cd401 Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Fri, 16 Nov 2007 22:48:29 +0100 Subject: [PATCH] Two memleak fixes in pacman Both memleak was an unfreed alpm_db_whatprovides list. Signed-off-by: Nagy Gabor --- src/pacman/deptest.c | 1 + src/pacman/sync.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/pacman/deptest.c b/src/pacman/deptest.c index 301558e..d17c821 100644 --- a/src/pacman/deptest.c +++ b/src/pacman/deptest.c @@ -70,6 +70,7 @@ int pacman_deptest(alpm_list_t *targets) break; } } + alpm_list_free(provides); } if(!found) { diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 5f1072f..8b8fbea 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -526,12 +526,13 @@ int sync_trans(alpm_list_t *targets, int sync_only) if(!found) { /* targ not found in sync db, searching for providers... */ const char *pname = NULL; - for(j = sync_dbs; j; j = alpm_list_next(j)) { + for(j = snc_dbs; j; j = alpm_list_next(j)) { pmdb_t *db = alpm_list_getdata(j); alpm_list_t *prov = alpm_db_whatprovides(db, targ); if(prov) { pmpkg_t *pkg = alpm_list_getdata(prov); pname = alpm_pkg_get_name(pkg); + alpm_list_free(prov); break; } } -- 1.5.3.5