Commit befe2eac authored by anonymous's avatar anonymous
Browse files

Fix leak when realloc fails

parent 7ae0830f
......@@ -518,10 +518,12 @@ uint32_t segment_mergeTables(conv_table_t *set1, conv_table_t *set2)
if (!numMergeTables) return 0;
// Grow the list to hold the new tables.
void *tmp = set1->Tables;
set1->Tables = (subtable_t *) realloc(set1->Tables,
(set1->numTables + numMergeTables) *
sizeof(subtable_t));
if (!set1->Tables) {
X_FREE(tmp);
set1->numTables = 0;
BD_DEBUG(DBG_BDPLUS,"[segment] Out of memory.\n");
return 0;
......
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