From 57a2df224a4bcf4463937d5e121f917d450c144f Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 23 Jul 2014 11:13:17 -0400 Subject: Fix memory leaks in extract tar. --- Source/cmSystemTools.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 444e143..fbb4416 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1701,6 +1701,8 @@ bool extract_tar(const char* outFileName, bool verbose, { cmSystemTools::Error("Problem with archive_read_open_file(): ", archive_error_string(a)); + archive_write_free(ext); + archive_read_close(a); return false; } for (;;) @@ -1776,6 +1778,7 @@ bool extract_tar(const char* outFileName, bool verbose, } } } + archive_write_free(ext); archive_read_close(a); archive_read_finish(a); return r == ARCHIVE_EOF || r == ARCHIVE_OK; -- cgit v0.12