From 64055e0f74ef5ed933988ff5af1743a919b9a325 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Mon, 2 Jan 2006 13:14:00 +0000 Subject: fixed various memory leaks --- lib/libalpm/add.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/add.c') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index ea0b29d2..3a610c85 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -191,7 +191,6 @@ error: int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data) { PMList *lp; - PMList *skiplist = NULL; ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); @@ -266,6 +265,8 @@ int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data) /* Check for file conflicts */ if(!(trans->flags & PM_TRANS_FLAG_FORCE)) { + PMList *skiplist = NULL; + EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL); _alpm_log(PM_LOG_FLOW1, "looking for file conflicts"); @@ -280,6 +281,7 @@ int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data) for(lp = skiplist; lp; lp = lp->next) { trans->skiplist = pm_list_add(trans->skiplist, lp->data); } + FREELISTPTR(skiplist); EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_DONE, NULL, NULL); } @@ -459,6 +461,7 @@ int add_commit(pmtrans_t *trans, pmdb_t *db) errors++; unlink(temp); FREE(temp); + FREE(md5_orig); close(fd); continue; } -- cgit v1.2.3-70-g09d2