diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-11-08 06:54:17 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-11-08 07:54:10 +0100 |
commit | d9c4917b9ec7da94ecacb3e3dd1ea28d41ce6889 (patch) | |
tree | 2d04b4f3b39bff69cf780052dea26b73eae22e5e /src/vmspawn | |
parent | tree-wide: fix typo (diff) | |
download | systemd-d9c4917b9ec7da94ecacb3e3dd1ea28d41ce6889.tar.xz systemd-d9c4917b9ec7da94ecacb3e3dd1ea28d41ce6889.zip |
vmspawn: fix memleak
Fixes CID#1523912.
Diffstat (limited to 'src/vmspawn')
-rw-r--r-- | src/vmspawn/vmspawn.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 00166b2f7a..7a30912099 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -141,9 +141,9 @@ static int parse_argv(int argc, char *argv[]) { break; case ARG_QEMU_SMP: - arg_qemu_smp = strdup(optarg); - if (!arg_qemu_smp) - return log_oom(); + r = free_and_strdup_warn(&arg_qemu_smp, optarg); + if (r < 0) + return r; break; case ARG_QEMU_MEM: |