From d9c4917b9ec7da94ecacb3e3dd1ea28d41ce6889 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 8 Nov 2023 14:54:17 +0900 Subject: vmspawn: fix memleak Fixes CID#1523912. --- src/vmspawn/vmspawn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/vmspawn') 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: -- cgit v1.2.3