chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0cc1125
)
conf-parser: don't leak section names
author
Tom Gundersen
<teg@jklm.no>
Wed, 20 Nov 2013 16:51:42 +0000
(17:51 +0100)
committer
Tom 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
patch
|
blob
|
history
diff --git
a/src/shared/conf-parser.c
b/src/shared/conf-parser.c
index efd2147e798acc86ddb8ce65e1015d77f758e465..95d64fcca2541c159af0d02f36f01a8c721adf00 100644
(file)
--- 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);