Commit acb8f197 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:3400], fix other memory leak

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@30232 c7de825b-a66e-492c-adef-691d508d4ae1
parent efeac441
......@@ -791,6 +791,13 @@ static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoin
TOKUDB_DBUG_RETURN(error);
}
static int
smart_dbt_callback_verify_frm (DBT const *key, DBT const *row, void *context) {
DBT* stored_frm = (DBT *)context;
stored_frm->size = row->size;
stored_frm->data = row->data;
return 0;
}
static int tokudb_discover(handlerton *hton, THD* thd, const char *db,
const char *name,
uchar **frmblob,
......@@ -800,7 +807,6 @@ static int tokudb_discover(handlerton *hton, THD* thd, const char *db,
int error;
DB* status_db = NULL;
DB_TXN* txn = NULL;
// TODO: open status dictionary, read frmdata, and pass it back, and figure out how to free it
char path[FN_REFLEN + 1];
uchar* saved_frm_data = NULL;
HA_METADATA_KEY curr_key = hatoku_frm_data;
......@@ -815,13 +821,14 @@ static int tokudb_discover(handlerton *hton, THD* thd, const char *db,
key.data = &curr_key;
key.size = sizeof(curr_key);
value.flags = DB_DBT_MALLOC;
error = status_db->get(
error = status_db->getf_set(
status_db,
txn,
txn,
0,
&key,
&value,
0
smart_dbt_callback_verify_frm,
&value
);
if (error) {
goto cleanup;
......
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