From 2fbb04140c4ac31baac4dc0b67cb9291383ab63a Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 31 Dec 2014 01:17:49 +0100 Subject: [PATCH] at_deprecated was causing a small memory leak. --- src/kernel/config.c | 1 + src/util/attrib.c | 4 ++++ src/util/attrib.h | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/kernel/config.c b/src/kernel/config.c index 1de8c8c5f..0e3d9802e 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -1144,6 +1144,7 @@ void kernel_done(void) * calling it is optional, e.g. a release server will most likely not do it. */ translation_done(); + free_attribs(); } attrib_type at_germs = { diff --git a/src/util/attrib.c b/src/util/attrib.c index d344cdc07..5cf9957c6 100644 --- a/src/util/attrib.c +++ b/src/util/attrib.c @@ -355,3 +355,7 @@ void a_write(struct storage *store, const attrib * attribs, const void *owner) } WRITE_TOK(store, "end"); } + +void free_attribs(void) { + cb_clear(&cb_deprecated); +} diff --git a/src/util/attrib.h b/src/util/attrib.h index 7dc3e1a3d..4c71f36f6 100644 --- a/src/util/attrib.h +++ b/src/util/attrib.h @@ -79,6 +79,8 @@ extern "C" { extern void a_write(struct storage *store, const attrib * attribs, const void *owner); + void free_attribs(void); + #define DEFAULT_AGE NULL #define DEFAULT_INIT NULL #define DEFAULT_FINALIZE NULL