29 lines
877 B
Diff
29 lines
877 B
Diff
From 28f01b38365c407736aec0590920203f25ff18b9 Mon Sep 17 00:00:00 2001
|
|
From: Juan RP <xtraeme@voidlinux.eu>
|
|
Date: Sun, 26 Jul 2015 08:15:07 +0200
|
|
Subject: [PATCH 05/30] xbps_transaction_package_replace: fix a resource leak
|
|
(CID #98688).
|
|
|
|
---
|
|
lib/transaction_package_replace.c | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
--- lib/transaction_package_replace.c
|
|
+++ lib/transaction_package_replace.c
|
|
@@ -121,8 +121,12 @@ xbps_transaction_package_replace(struct xbps_handle *xhp, xbps_array_t pkgs)
|
|
*/
|
|
xbps_dictionary_set_cstring_nocopy(instd,
|
|
"transaction", "remove");
|
|
- if (!xbps_array_add_first(pkgs, instd))
|
|
+ if (!xbps_array_add_first(pkgs, instd)) {
|
|
+ xbps_object_iterator_release(iter);
|
|
+ free(pkgname);
|
|
+ free(curpkgname);
|
|
return EINVAL;
|
|
+ }
|
|
free(curpkgname);
|
|
}
|
|
xbps_object_iterator_release(iter);
|
|
--
|
|
2.6.1
|
|
|