Commit 0c7758a5 authored by ziggurat29's avatar ziggurat29 Committed by Marcel Stör
Browse files

Fix occasional luac.cross crash (#2661)

A block of memory is accessed after having been freed. This was obscured by the fact that 'oBuf' is a pointer into the middle of the block 'dynamicTables', so when dynamicTables is freed, oBuf is pointing to freed memory. Occasionally, luac.cross would crash because of this.
parent f0a240aa
...@@ -568,7 +568,6 @@ int uzlib_compress (uchar **dest, uint *destLen, const uchar *src, uint srcLen) ...@@ -568,7 +568,6 @@ int uzlib_compress (uchar **dest, uint *destLen, const uchar *src, uint srcLen)
status = UZLIB_OK; status = UZLIB_OK;
} }
FREE(dynamicTables);
for (i=0; i<20;i++) DBG_PRINT("count %u = %u\n",i,debugCounts[i]); for (i=0; i<20;i++) DBG_PRINT("count %u = %u\n",i,debugCounts[i]);
if (status == UZLIB_OK) { if (status == UZLIB_OK) {
...@@ -581,5 +580,7 @@ int uzlib_compress (uchar **dest, uint *destLen, const uchar *src, uint srcLen) ...@@ -581,5 +580,7 @@ int uzlib_compress (uchar **dest, uint *destLen, const uchar *src, uint srcLen)
FREE(oBuf->buffer); FREE(oBuf->buffer);
} }
FREE(dynamicTables);
return status; return status;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment