index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Nagy Gabor <ngaba@bibl.u-szeged.hu> | 2009-06-09 17:23:46 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-09-08 22:04:14 -0500 |
commit | 0da96abc900560f21c643b255c94a60232f4a24b (patch) | |
tree | 8bd2ac5027ffd7c181daaf13205d2372fbcd39ae /lib/libalpm/package.c | |
parent | b7db46d610efd5f71d5e4e887fed7a3fd3b3dd86 (diff) |
-rw-r--r-- | lib/libalpm/package.c | 11 |
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 002b1c89..2e0d0dfd 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -858,7 +858,11 @@ void _alpm_pkg_free(pmpkg_t *pkg) FREE(pkg); } -/* Free transaction specific fields */ +/* This function should be used when removing a target from upgrade/sync target list + * Case 1: If pkg is a loaded package file (PKG_FROM_FILE), it will be freed. + * Case 2: If pkg is a pkgcache entry (PKG_FROM_CACHE), it won't be freed, + * only the transaction specific fields of pkg will be freed. + */ void _alpm_pkg_free_trans(pmpkg_t *pkg) { ALPM_LOG_FUNC; @@ -867,6 +871,11 @@ void _alpm_pkg_free_trans(pmpkg_t *pkg) return; } + if(pkg->origin == PKG_FROM_FILE) { + _alpm_pkg_free(pkg); + return; + } + alpm_list_free(pkg->removes); pkg->removes = NULL; } |