chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
env-util: fix memory leak (#5962)
[elogind.git]
/
src
/
basic
/
env-util.c
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 (r < 0)
return r;
- if (!env_assignment_is_valid(uce))
+ if (!env_assignment_is_valid(uce)) {
+ free(uce);
return -EINVAL;
return -EINVAL;
+ }
return strv_env_replace(environment, uce);
}
return strv_env_replace(environment, uce);
}