Commit 4f703fe7 authored by Michael Widenius's avatar Michael Widenius

Fixed MDEV-348: 5.5 valgrind warinings on maria tests

parent 0b93b444
...@@ -193,14 +193,17 @@ int maria_close(register MARIA_HA *info) ...@@ -193,14 +193,17 @@ int maria_close(register MARIA_HA *info)
else else
share_can_be_freed= TRUE; share_can_be_freed= TRUE;
if (share->state_history && share->state_history->trid) if (share->state_history)
{
if (share->state_history->trid) /* If not visible for all */
{ {
MARIA_STATE_HISTORY_CLOSED *history; MARIA_STATE_HISTORY_CLOSED *history;
DBUG_PRINT("info", ("Storing state history")); DBUG_PRINT("info", ("Storing state history"));
/* /*
Here we ignore the unlikely case that we don't have memory to Here we ignore the unlikely case that we don't have memory
store the state. In the worst case what happens is that any transaction to store the state. In the worst case what happens is that
that tries to access this table will get a wrong status information. any transaction that tries to access this table will get a
wrong status information.
*/ */
if ((history= (MARIA_STATE_HISTORY_CLOSED *) if ((history= (MARIA_STATE_HISTORY_CLOSED *)
my_malloc(sizeof(*history), MYF(MY_WME)))) my_malloc(sizeof(*history), MYF(MY_WME))))
...@@ -210,6 +213,9 @@ int maria_close(register MARIA_HA *info) ...@@ -210,6 +213,9 @@ int maria_close(register MARIA_HA *info)
if (my_hash_insert(&maria_stored_state, (uchar*) history)) if (my_hash_insert(&maria_stored_state, (uchar*) history))
my_free(history); my_free(history);
} }
}
else
my_free(share->state_history);
/* Marker for concurrent checkpoint */ /* Marker for concurrent checkpoint */
share->state_history= 0; share->state_history= 0;
} }
......
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