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 efd2147e798acc86ddb8ce65e1015d77f758e465..95d64fcca2541c159af0d02f36f01a8c721adf00 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);