summaryrefslogtreecommitdiffstats
path: root/src/pacman/add.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-11-22 04:51:06 +0100
committerAaron Griffin <aaron@archlinux.org>2006-11-22 04:51:06 +0100
commit99d0c0024624c7241a7f5e0d1d3f8b1c6f96a19e (patch)
tree2c0f139dadbe2b0045884257c5229d9a2159e945 /src/pacman/add.c
parentcb65f08d2fc13005bba953c42f815d9dda23111f (diff)
downloadpacman-99d0c0024624c7241a7f5e0d1d3f8b1c6f96a19e.tar.gz
pacman-99d0c0024624c7241a7f5e0d1d3f8b1c6f96a19e.tar.xz
* Fixed a double free which happened in 2 cases in --sync
Diffstat (limited to 'src/pacman/add.c')
-rw-r--r--src/pacman/add.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pacman/add.c b/src/pacman/add.c
index 9b5a650f..b4d7c3ad 100644
--- a/src/pacman/add.c
+++ b/src/pacman/add.c
@@ -103,7 +103,6 @@ int pacman_add(list_t *targets)
}
MSG(CL, "\n");
}
- alpm_list_free(data);
break;
case PM_ERR_CONFLICTING_DEPS:
for(i = alpm_list_first(data); i; i = alpm_list_next(i)) {
@@ -111,7 +110,6 @@ int pacman_add(list_t *targets)
MSG(NL, _(":: %s: conflicts with %s"),
alpm_dep_getinfo(miss, PM_DEP_TARGET), alpm_dep_getinfo(miss, PM_DEP_NAME));
}
- alpm_list_free(data);
break;
case PM_ERR_FILE_CONFLICTS:
for(i = alpm_list_first(data); i; i = alpm_list_next(i)) {
@@ -132,7 +130,6 @@ int pacman_add(list_t *targets)
break;
}
}
- alpm_list_free(data);
MSG(NL, _("\nerrors occurred, no packages were upgraded.\n"));
break;
case PM_ERR_DISK_FULL:
@@ -142,7 +139,6 @@ int pacman_add(list_t *targets)
freespace = alpm_list_getdata(i);
MSG(NL, _(":: %.1f MB required, have %.1f MB"),
(double)(*pkgsize / 1048576.0), (double)(*freespace / 1048576.0));
- alpm_list_free(data);
break;
default:
break;
@@ -160,6 +156,10 @@ int pacman_add(list_t *targets)
}
cleanup:
+ if(data) {
+ alpm_list_free(data);
+ data = NULL;
+ }
if(alpm_trans_release() == -1) {
ERR(NL, _("failed to release transaction (%s)\n"), alpm_strerror(pm_errno));
retval=1;