refs #5889 fix memory leak

git-svn-id: file:///svn/toku/tokudb@52556 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Leif Walsh 2013-04-17 00:01:28 -04:00 committed by Yoni Fogel
parent 708364cb98
commit a767adef3a

View file

@ -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;
} }