From cf6de2f6fdecf58e7110ac7ef9d304abf26d8544 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 24 Apr 2017 19:27:27 +0200 Subject: [PATCH] valgrind: fix memory leak --- lib/plugin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/plugin.c b/lib/plugin.c index 4aab33115..4b3134dd7 100644 --- a/lib/plugin.c +++ b/lib/plugin.c @@ -11,6 +11,11 @@ /** Global list of all known plugins */ struct list plugins = LIST_INIT(); +__attribute__((destructor(999))) static void __dtor_plugins() +{ + list_destroy(&plugins, NULL, false); +} + int plugin_init(struct plugin *p) { assert(p->state == STATE_DESTROYED);