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:
06b7f7b
)
core: fix resource leak in manager_environment_add
author
Andreas Henriksson
<andreas@fatal.se>
Tue, 16 Sep 2014 19:11:02 +0000
(21:11 +0200)
committer
Daniel Mack
<daniel@zonque.org>
Tue, 16 Sep 2014 19:47:24 +0000
(21:47 +0200)
Second error path must free the (potentially) allocated memory in the
first code chunk before returning.
Found by coverity. Fixes: CID#
1237750
src/core/manager.c
patch
|
blob
|
history
diff --git
a/src/core/manager.c
b/src/core/manager.c
index 0770727cde6651bf51758ab60a596b36829e2f89..e0c1cd187e87db3d5aca127b083bcb8a30cf9475 100644
(file)
--- a/
src/core/manager.c
+++ b/
src/core/manager.c
@@
-2751,8
+2751,10
@@
int manager_environment_add(Manager *m, char **minus, char **plus) {
if (!strv_isempty(plus)) {
b = strv_env_merge(2, l, plus);
- if (!b)
+ if (!b) {
+ strv_free(a);
return -ENOMEM;
+ }
l = b;
}