Explorar o código

Fix memory leaks in extract tar.

Bill Hoffman %!s(int64=11) %!d(string=hai) anos
pai
achega
57a2df224a
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      Source/cmSystemTools.cxx

+ 3 - 0
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;