mirror of
https://github.com/systemd/systemd.git
synced 2025-01-21 22:04:01 +03:00
journalctl: fix memleak
This is harmless, it would only happen if --verify-key is used multiple times. But let's fix it for correctness. CID ##1368415.
This commit is contained in:
parent
6fefc0eded
commit
e50412ef19
@ -683,11 +683,12 @@ static int parse_argv(int argc, char *argv[]) {
|
|||||||
|
|
||||||
case ARG_VERIFY_KEY:
|
case ARG_VERIFY_KEY:
|
||||||
arg_action = ACTION_VERIFY;
|
arg_action = ACTION_VERIFY;
|
||||||
arg_verify_key = strdup(optarg);
|
r = free_and_strdup(&arg_verify_key, optarg);
|
||||||
if (!arg_verify_key)
|
if (r < 0)
|
||||||
return -ENOMEM;
|
return r;
|
||||||
arg_merge = false;
|
|
||||||
string_erase(optarg);
|
string_erase(optarg);
|
||||||
|
|
||||||
|
arg_merge = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ARG_INTERVAL:
|
case ARG_INTERVAL:
|
||||||
@ -888,7 +889,7 @@ static int parse_argv(int argc, char *argv[]) {
|
|||||||
* to users, and automatically turn --unit= into --user-unit= if combined with --user. */
|
* to users, and automatically turn --unit= into --user-unit= if combined with --user. */
|
||||||
r = strv_extend_strv(&arg_user_units, arg_system_units, true);
|
r = strv_extend_strv(&arg_user_units, arg_system_units, true);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return -ENOMEM;
|
return r;
|
||||||
|
|
||||||
arg_system_units = strv_free(arg_system_units);
|
arg_system_units = strv_free(arg_system_units);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user