diff options
author | Nagy Gabor <ngaba@petra.hos.u-szeged.hu> | 2007-07-20 10:43:55 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-07-20 16:37:24 +0200 |
commit | 0d00f7095f1f26b981747c678551436e2495c68e (patch) | |
tree | 0ec1795509ffc487ac78f7b3af76d03865540c07 /lib/libalpm | |
parent | b0c064d59b8786a1e169e305a263fc13e2d7ed32 (diff) | |
download | pacman-0d00f7095f1f26b981747c678551436e2495c68e.tar.gz pacman-0d00f7095f1f26b981747c678551436e2495c68e.tar.xz |
libalpm/sync.c : two memleak fixes in _alpm_sync_prepare.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Diffstat (limited to 'lib/libalpm')
-rw-r--r-- | lib/libalpm/sync.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 7e83120e..005123d4 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -433,13 +433,8 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync } /* re-order w.r.t. dependencies */ - alpm_list_t *sortlist = NULL; + alpm_list_t *sortlist = _alpm_sortbydeps(list, PM_TRANS_TYPE_ADD); alpm_list_t *newpkgs = NULL; - for(i = trans->packages; i; i = i->next) { - pmsyncpkg_t *s = i->data; - sortlist = alpm_list_add(sortlist, s->pkg); - } - sortlist = _alpm_sortbydeps(sortlist, PM_TRANS_TYPE_ADD); for(i = sortlist; i; i = i->next) { for(j = trans->packages; j; j = j->next) { pmsyncpkg_t *s = j->data; @@ -459,13 +454,13 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync if(deps) { if(data) { *data = deps; - deps = NULL; + } else { + FREELIST(deps); } pm_errno = PM_ERR_UNSATISFIED_DEPS; ret = -1; goto cleanup; } - } /* We don't care about conflicts if we're just printing uris */ |