mirror of
https://github.com/systemd/systemd.git
synced 2026-08-04 23:20:32 +00:00
conf-parser: don't leak section names
If we encounter an unknown section, we must free the previous section before clearing the pointer.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user