From 9e5c7de33bec13cf1cbc4a5612b9bceb93b6e93a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 22 Sep 2012 23:28:16 +0200 Subject: [PATCH] xbps_dictionary_from_archive_entry: fixed internalizing uncompressed dictionaries. (cherry picked from commit 2debc5c5ee6db1a197fe3afebaa9463934707b10) --- lib/plist_archive_entry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/plist_archive_entry.c b/lib/plist_archive_entry.c index 19d7d996..449de626 100644 --- a/lib/plist_archive_entry.c +++ b/lib/plist_archive_entry.c @@ -141,10 +141,10 @@ xbps_dictionary_from_archive_entry(struct archive *ar, } uncomp_buf = _xbps_uncompress_plist_data(buf, buflen); - free(buf); if (uncomp_buf == NULL) { if (errno && errno != EAGAIN) { /* Error while decompressing */ + free(buf); return NULL; } else if (errno == EAGAIN) { /* Not a compressed data, try again */ @@ -156,5 +156,6 @@ xbps_dictionary_from_archive_entry(struct archive *ar, d = prop_dictionary_internalize(uncomp_buf); free(uncomp_buf); } + free(buf); return d; }