[systemd-commits] src/shared

Tom Gundersen tomegun at kemper.freedesktop.org
Wed Nov 20 08:50:59 PST 2013


 src/shared/conf-parser.c |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 91ffff9621757cb585bfce1cafc98218f89cc466
Author: Tom Gundersen <teg at jklm.no>
Date:   Wed Nov 20 17:51:42 2013 +0100

    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 efd2147..95d64fc 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);



More information about the systemd-commits mailing list