Skip to content
Permalink
Browse files
MDEV-15114: Fix memory leaks
When innobase_allocate_row_for_vcol() returns true (for failure),
it may already have invoked mem_heap_create(). However, some callers
would fail to invoke mem_heap_free().
  • Loading branch information
dr-m committed Jan 24, 2019
1 parent b572814 commit 46f712c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
@@ -966,11 +966,11 @@ row_ins_foreign_fill_virtual(

if (innobase_allocate_row_for_vcol(thd, index, &v_heap,
&mysql_table,
&record, &vcol_storage))
{
&record, &vcol_storage)) {
if (v_heap) mem_heap_free(v_heap);
*err = DB_OUT_OF_MEMORY;
goto func_exit;
}
goto func_exit;
}

for (ulint i = 0; i < n_v_fld; i++) {

@@ -1162,6 +1162,7 @@ row_upd_build_difference_binary(
&v_heap, heap, NULL, thd, mysql_table, record,
NULL, NULL, NULL);
if (vfield == NULL) {
if (v_heap) mem_heap_free(v_heap);
*error = DB_COMPUTE_VALUE_FAILED;
return(NULL);
}

0 comments on commit 46f712c

Please sign in to comment.