From 08a22ba1c9b0513d9a32509bbfe5b49261ee7676 Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Sat, 26 Jan 2013 15:03:01 +0530 Subject: [PATCH] Bug#16056813-MEMORY LEAK ON FILTERED SLAVE Due to not resetting a member (last_added) of Deferred events class inside a clean up function (Deferred_log_events::rewind), there is a memory leak on filtered slaves. Fix: Resetting last_added to NULL in rewind() function. sql/rpl_utility.cc: Resetting last_added to NULL to avoid memory leak --- sql/rpl_utility.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 8efb376b5b6..2643f2d6059 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -1117,6 +1117,7 @@ void Deferred_log_events::rewind() Log_event *ev= *(Log_event **) dynamic_array_ptr(&array, i); delete ev; } + last_added= NULL; if (array.elements > array.max_element) freeze_size(&array); reset_dynamic(&array);