]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: main: Freeing a bunch of static pointers
authorDavid Carlier <dcarlier@afilias.info>
Fri, 25 Sep 2015 11:02:25 +0000 (12:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 Sep 2015 12:00:00 +0000 (14:00 +0200)
static_table_key, get_http_auth_buff and swap_buffer static variables
are now freed during deinit and the two previously new functions are
called as well. In addition, the 'trash' string buffer is cleared.

src/haproxy.c

index bdfa31824e1cdefa9541a097424a92630d826093..f6ba96b381b75011248dc8def1fed03d0d758e16 100644 (file)
@@ -1448,6 +1448,11 @@ void deinit(void)
 
        userlist_free(userlist);
 
+       cfg_unregister_sections();
+
+       free_trash_buffers();
+       chunk_destroy(&trash);
+
        protocol_unbind_all();
 
 #if defined(USE_DEVICEATLAS)
@@ -1467,6 +1472,9 @@ void deinit(void)
        free(fdinfo);         fdinfo  = NULL;
        free(fdtab);          fdtab   = NULL;
        free(oldpids);        oldpids = NULL;
+       free(static_table_key); static_table_key = NULL;
+       free(get_http_auth_buff); get_http_auth_buff = NULL;
+       free(swap_buffer);    swap_buffer = NULL;
        free(global_listener_queue_task); global_listener_queue_task = NULL;
 
        list_for_each_entry_safe(log, logb, &global.logsrvs, list) {