chiark / gitweb /
conf-parser: don't leak section names
authorTom Gundersen <teg@jklm.no>
Wed, 20 Nov 2013 16:51:42 +0000 (17:51 +0100)
committerTom Gundersen <teg@jklm.no>
Wed, 20 Nov 2013 16:54:09 +0000 (17:54 +0100)
If we encounter an unknown section, we must free the previous section before
clearing the pointer.

src/shared/conf-parser.c

index efd2147..95d64fc 100644 (file)
@@ -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);