Commit 416e8c43 authored by Yoni Fogel's avatar Yoni Fogel

[t:2249] Fix memory leak introduced in r18617 (merge of 2249)

git-svn-id: file:///svn/toku/tokudb@18618 c7de825b-a66e-492c-adef-691d508d4ae1
parent b3f5306b
...@@ -3139,7 +3139,7 @@ brt_open(BRT t, const char *fname_in_env, int is_create, int only_create, CACHET ...@@ -3139,7 +3139,7 @@ brt_open(BRT t, const char *fname_in_env, int is_create, int only_create, CACHET
WHEN_BRTTRACE(fprintf(stderr, "BRTTRACE: %s:%d toku_brt_open(%s, \"%s\", %d, %p, %d, %p)\n", WHEN_BRTTRACE(fprintf(stderr, "BRTTRACE: %s:%d toku_brt_open(%s, \"%s\", %d, %p, %d, %p)\n",
__FILE__, __LINE__, fname_in_env, dbname, is_create, newbrt, nodesize, cachetable)); __FILE__, __LINE__, fname_in_env, dbname, is_create, newbrt, nodesize, cachetable));
char *fname_in_cwd = toku_cachetable_get_fname_in_cwd(cachetable, fname_in_env); char *fname_in_cwd = toku_cachetable_get_fname_in_cwd(cachetable, fname_in_env);
if (0) { died0: toku_free(fname_in_cwd); assert(r); return r; } if (0) { died0: if (fname_in_cwd) toku_free(fname_in_cwd); assert(r); return r; }
assert(is_create || !only_create); assert(is_create || !only_create);
t->db = db; t->db = db;
...@@ -3165,6 +3165,8 @@ brt_open(BRT t, const char *fname_in_env, int is_create, int only_create, CACHET ...@@ -3165,6 +3165,8 @@ brt_open(BRT t, const char *fname_in_env, int is_create, int only_create, CACHET
if (r!=0) goto died1; if (r!=0) goto died1;
r = brt_create_file(t, fname_in_cwd, &fd); r = brt_create_file(t, fname_in_cwd, &fd);
} }
toku_free(fname_in_cwd);
fname_in_cwd = NULL;
if (r != 0) goto died1; if (r != 0) goto died1;
// TODO: #2090 // TODO: #2090
r=toku_cachetable_openfd_with_filenum(&t->cf, cachetable, fd, r=toku_cachetable_openfd_with_filenum(&t->cf, cachetable, fd,
......
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