From: Aurelien DARRAGON Date: Wed, 14 Jun 2023 08:11:13 +0000 (+0200) Subject: BUG/MINOR: namespace: missing free in netns_sig_stop() X-Git-Tag: v2.9-dev1~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e17a3f5b1b5dca98efba5337274f3f719da2789;p=thirdparty%2Fhaproxy.git BUG/MINOR: namespace: missing free in netns_sig_stop() On soft-stop, netns_sig_stop() function is called to purge the shared namespace tree by iterating over each entries to free them. However, once an entry is cleaned up and removed from the tree, the entry itself isn't freed and this results into a minor leak when soft-stopping because entry was allocated using calloc() in netns_store_insert() when parsing the configuration. This could be backported in every stable versions. --- diff --git a/src/namespace.c b/src/namespace.c index 1fc843906b..9cc85a3847 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -54,6 +54,7 @@ static void netns_sig_stop(struct sig_handler *sh) entry = container_of(node, struct netns_entry, node); free(entry->node.key); close(entry->fd); + free(entry); node = next; } }