Commit 9542e886 authored by Yoni Fogel's avatar Yoni Fogel

[t:2555] Prevent toku_free(NULL) in regular (not LOADER_USE_PUTS) loader.

If generate_row_for_put sets flags to 0, skey/sval.data are NULL and we unconditionally free them.

git-svn-id: file:///svn/toku/tokudb@19634 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5c2f6b60
...@@ -877,8 +877,9 @@ static int loader_do_i (BRTLOADER bl, ...@@ -877,8 +877,9 @@ static int loader_do_i (BRTLOADER bl,
{ // clean up this stuff early, to save memory { // clean up this stuff early, to save memory
toku_free(skey.data); //s(key,val).data might be NULL if flags==0 (see above)
toku_free(sval.data); if (skey.data) toku_free(skey.data);
if (sval.data) toku_free(sval.data);
toku_free (pkey.data); toku_free (pkey.data);
toku_free (pval.data); toku_free (pval.data);
skey.data = sval.data = pkey.data = pval.data = NULL; // set to NULL so that the final cleanup won't free them again. skey.data = sval.data = pkey.data = pval.data = NULL; // set to NULL so that the final cleanup won't free them again.
......
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