]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: namespace: missing free in netns_sig_stop()
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 14 Jun 2023 08:11:13 +0000 (10:11 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 14 Jun 2023 09:27:29 +0000 (11:27 +0200)
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.

src/namespace.c

index 1fc843906b827aad31b47c00649180c847b93636..9cc85a38477919d8a0f0c65a324b5719d6142075 100644 (file)
@@ -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;
        }
 }