Commit a49e627e authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5889 fix memory leak

git-svn-id: file:///svn/toku/tokudb@52556 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1a7801fd
...@@ -543,11 +543,16 @@ ft_handle_open_for_redirect(FT_HANDLE *new_ftp, const char *fname_in_env, TOKUTX ...@@ -543,11 +543,16 @@ ft_handle_open_for_redirect(FT_HANDLE *new_ftp, const char *fname_in_env, TOKUTX
toku_ft_handle_set_compression_method(t, old_h->h->compression_method); toku_ft_handle_set_compression_method(t, old_h->h->compression_method);
CACHETABLE ct = toku_cachefile_get_cachetable(old_h->cf); CACHETABLE ct = toku_cachefile_get_cachetable(old_h->cf);
int r = toku_ft_handle_open_with_dict_id(t, fname_in_env, 0, 0, ct, txn, old_h->dict_id); int r = toku_ft_handle_open_with_dict_id(t, fname_in_env, 0, 0, ct, txn, old_h->dict_id);
if (r == 0) { if (r != 0) {
goto cleanup;
}
assert(t->ft->dict_id.dictid == old_h->dict_id.dictid); assert(t->ft->dict_id.dictid == old_h->dict_id.dictid);
*new_ftp = t; *new_ftp = t;
}
cleanup:
if (r != 0) {
toku_ft_handle_close(t);
}
return r; return r;
} }
......
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