xbps_dictionary_from_archive_entry: fixed internalizing uncompressed dictionaries.

(cherry picked from commit 2debc5c5ee6db1a197fe3afebaa9463934707b10)
This commit is contained in:
Juan RP 2012-09-22 23:28:16 +02:00
parent 83688cf8ec
commit 9e5c7de33b

View File

@ -141,10 +141,10 @@ xbps_dictionary_from_archive_entry(struct archive *ar,
} }
uncomp_buf = _xbps_uncompress_plist_data(buf, buflen); uncomp_buf = _xbps_uncompress_plist_data(buf, buflen);
free(buf);
if (uncomp_buf == NULL) { if (uncomp_buf == NULL) {
if (errno && errno != EAGAIN) { if (errno && errno != EAGAIN) {
/* Error while decompressing */ /* Error while decompressing */
free(buf);
return NULL; return NULL;
} else if (errno == EAGAIN) { } else if (errno == EAGAIN) {
/* Not a compressed data, try again */ /* Not a compressed data, try again */
@ -156,5 +156,6 @@ xbps_dictionary_from_archive_entry(struct archive *ar,
d = prop_dictionary_internalize(uncomp_buf); d = prop_dictionary_internalize(uncomp_buf);
free(uncomp_buf); free(uncomp_buf);
} }
free(buf);
return d; return d;
} }