From: Tom Gundersen Date: Wed, 20 Nov 2013 16:51:42 +0000 (+0100) Subject: conf-parser: don't leak section names X-Git-Tag: v209~1397 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=91ffff9621757cb585bfce1cafc98218f89cc466 conf-parser: don't leak section names If we encounter an unknown section, we must free the previous section before clearing the pointer. --- diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index efd2147e7..95d64fcca 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -260,6 +260,7 @@ static int parse_line(const char* unit, "Unknown section '%s'. Ignoring.", n); free(n); + free(*section); *section = NULL; } else { free(*section);