mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 06:44:16 +01:00
refs #5889 fix memory leak
git-svn-id: file:///svn/toku/tokudb@52556 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
708364cb98
commit
a767adef3a
1 changed files with 8 additions and 3 deletions
9
ft/ft.cc
9
ft/ft.cc
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue