summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2014-07-23 15:13:17 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2014-07-23 15:13:17 (GMT)
commit57a2df224a4bcf4463937d5e121f917d450c144f (patch)
tree3b25d0c597291233ed8e063d52dd2a337827a793 /Source/cmSystemTools.cxx
parentfe4e6ed991b936e147536832bbf7190f05887814 (diff)
downloadCMake-57a2df224a4bcf4463937d5e121f917d450c144f.zip
CMake-57a2df224a4bcf4463937d5e121f917d450c144f.tar.gz
CMake-57a2df224a4bcf4463937d5e121f917d450c144f.tar.bz2
Fix memory leaks in extract tar.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx3
1 files changed, 3 insertions, 0 deletions
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;