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:
8c23552
)
env-util: fix memory leak (#5962)
author
Ronny Chevalier
<chevalier.ronny@gmail.com>
Sun, 14 May 2017 14:30:40 +0000
(16:30 +0200)
committer
Sven Eden
<yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:52 +0000
(09:46 +0200)
If cunescape succeeds, but the assignment is not valid, uce is not freed.
src/basic/env-util.c
patch
|
blob
|
history
diff --git
a/src/basic/env-util.c
b/src/basic/env-util.c
index 1b8a96def7814efec23e94fb029a2b1eec69534b..cb73c9caa17d4b9e7f4290309ebd27a36b4eea40 100644
(file)
--- a/
src/basic/env-util.c
+++ b/
src/basic/env-util.c
@@
-800,8
+800,10
@@
int deserialize_environment(char ***environment, const char *line) {
if (r < 0)
return r;
- if (!env_assignment_is_valid(uce))
+ if (!env_assignment_is_valid(uce)) {
+ free(uce);
return -EINVAL;
+ }
return strv_env_replace(environment, uce);
}