Sfoglia il codice sorgente

Merge pull request #4966 from richardkchapman/uncompress-leak-on-exception

HPCC-10184 Potential memory leak in uncompress routine

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 11 anni fa
parent
commit
df1a9a4d1c
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      system/jlib/jptree.cpp

+ 2 - 1
system/jlib/jptree.cpp

@@ -812,7 +812,8 @@ static void *uncompress(const void *src, size32_t &sz)
         assertex(sz);
         expander = createLZWExpander();
         src = ((const char *)src) + sizeof(size32_t);
-        void *uncompressedValue = malloc(sz); assertex(uncompressedValue);
+        uncompressedValue = malloc(sz);
+        assertex(uncompressedValue);
         expander->init(src);
         expander->expand(uncompressedValue);
         expander->Release();