summaryrefslogtreecommitdiffstats
path: root/src/vmspawn
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-11-08 06:54:17 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-11-08 07:54:10 +0100
commitd9c4917b9ec7da94ecacb3e3dd1ea28d41ce6889 (patch)
tree2d04b4f3b39bff69cf780052dea26b73eae22e5e /src/vmspawn
parenttree-wide: fix typo (diff)
downloadsystemd-d9c4917b9ec7da94ecacb3e3dd1ea28d41ce6889.tar.xz
systemd-d9c4917b9ec7da94ecacb3e3dd1ea28d41ce6889.zip
vmspawn: fix memleak
Fixes CID#1523912.
Diffstat (limited to 'src/vmspawn')
-rw-r--r--src/vmspawn/vmspawn.c6
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: