From 5d59a15faf67d921dfb190195c07bf4a70bca137 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 29 Dec 2012 07:13:49 +0100 Subject: [PATCH] libxbps: even if executing a pre-remove action fails, continue removing pkg. This is no reason to stop removing a pkg, so just continue and fully remove the pkg. --- lib/package_remove.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/package_remove.c b/lib/package_remove.c index 3118e19a..a207fc01 100644 --- a/lib/package_remove.c +++ b/lib/package_remove.c @@ -266,7 +266,7 @@ xbps_remove_pkg(struct xbps_handle *xhp, "execute pre ACTION: %s", pkgver, strerror(errno)); rv = errno; - goto out; + goto purge; } } /* @@ -349,6 +349,7 @@ purge: */ buf = xbps_xasprintf("%s/.%s.plist", xhp->metadir, pkgname); if (remove(buf) == -1) { + free(buf); if (errno != ENOENT) { xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FAIL, rv, pkgname, version, @@ -356,6 +357,7 @@ purge: pkgver, strerror(errno)); } } + free(buf); /* * Unregister package from pkgdb. */ @@ -367,8 +369,6 @@ purge: xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_DONE, 0, pkgname, version, NULL); out: - if (buf != NULL) - free(buf); if (pkgname != NULL) free(pkgname);