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:
91e7bad
)
shared: fix resource leak in config_parse_default_instance
author
Andreas Henriksson
<andreas@fatal.se>
Tue, 16 Sep 2014 19:36:26 +0000
(21:36 +0200)
committer
Daniel Mack
<daniel@zonque.org>
Tue, 16 Sep 2014 19:49:56 +0000
(21:49 +0200)
The recently allocated "printed" is not freed on error path.
Found by coverity. Fixes: CID#
1237745
src/shared/install.c
patch
|
blob
|
history
diff --git
a/src/shared/install.c
b/src/shared/install.c
index 5d3fcf5e32bc0ddf2afef1b9ce7c22078d79ebf7..61e572bdf3e99058d09fcfcaa92439283be1f91b 100644
(file)
--- a/
src/shared/install.c
+++ b/
src/shared/install.c
@@
-1025,8
+1025,10
@@
static int config_parse_default_instance(
if (r < 0)
return r;
- if (!unit_instance_is_valid(printed))
+ if (!unit_instance_is_valid(printed)) {
+ free(printed);
return -EINVAL;
+ }
free(i->default_instance);
i->default_instance = printed;