mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
shared: fix memory leak in error path
Coverity 1446676
This commit is contained in:
parent
d9a650bbe8
commit
3178014709
@ -175,7 +175,7 @@ int deserialize_dual_timestamp(const char *value, dual_timestamp *t) {
|
||||
}
|
||||
|
||||
int deserialize_environment(const char *value, char ***list) {
|
||||
char *unescaped;
|
||||
_cleanup_free_ char *unescaped = NULL;
|
||||
int r;
|
||||
|
||||
assert(value);
|
||||
@ -187,9 +187,10 @@ int deserialize_environment(const char *value, char ***list) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to unescape: %m");
|
||||
|
||||
r = strv_env_replace_consume(list, unescaped);
|
||||
r = strv_env_replace_consume(list, TAKE_PTR(unescaped));
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to append environment variable: %m");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user