Fix a memory leak on shutdown
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 25 Jul 2015 10:32:06 +0000 (12:32 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Mon, 3 Aug 2015 21:07:48 +0000 (23:07 +0200)
src/plugin.c

index 5d31e46..97352c4 100644 (file)
@@ -181,13 +181,13 @@ static void destroy_read_heap (void) /* {{{ */
 
        while (42)
        {
-               callback_func_t *cf;
+               read_func_t *rf;
 
-               cf = c_heap_get_root (read_heap);
-               if (cf == NULL)
+               rf = c_heap_get_root (read_heap);
+               if (rf == NULL)
                        break;
-
-               destroy_callback (cf);
+               sfree (rf->rf_name);
+               destroy_callback ((callback_func_t *) rf);
        }
 
        c_heap_destroy (read_heap);