Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: src/xz/list.c

Issue 12568011: Update XZ Utils to 5.0.4 (third_party) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/xz/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« README.chromium ('K') | « src/xz/coder.c ('k') | src/xz/message.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/xz/list.c
===================================================================
--- src/xz/list.c (revision 87706)
+++ src/xz/list.c (working copy)
@@ -382,14 +382,9 @@
if (buf.u8[0] == 0)
goto data_error;
- lzma_block block;
- lzma_filter filters[LZMA_FILTERS_MAX + 1];
-
- // Initialize the pointers so that they can be passed to free().
- for (size_t i = 0; i < ARRAY_SIZE(filters); ++i)
- filters[i].options = NULL;
-
// Initialize the block structure and decode Block Header Size.
+ lzma_filter filters[LZMA_FILTERS_MAX + 1];
+ lzma_block block;
block.version = 0;
block.check = iter->stream.flags->check;
block.filters = filters;
@@ -437,6 +432,10 @@
break;
case LZMA_DATA_ERROR:
+ // Free the memory allocated by lzma_block_header_decode().
+ for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i)
+ free(filters[i].options);
+
goto data_error;
default:
@@ -466,14 +465,6 @@
// Show the error message.
message_error("%s: %s", pair->src_name,
message_strm(LZMA_DATA_ERROR));
-
- // Free the memory allocated by lzma_block_header_decode().
- // This is truly needed only if we get here after a succcessful
- // call to lzma_block_header_decode() but it doesn't hurt to
- // always do it.
- for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i)
- free(filters[i].options);
-
return true;
}
« README.chromium ('K') | « src/xz/coder.c ('k') | src/xz/message.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698