Explicitly initialize vmd_vm pointer with NULL before calling vm_register.
authormbuhl <mbuhl@openbsd.org>
Wed, 22 Feb 2023 10:04:45 +0000 (10:04 +0000)
committermbuhl <mbuhl@openbsd.org>
Wed, 22 Feb 2023 10:04:45 +0000 (10:04 +0000)
Found by codechecker.
ok dv@

usr.sbin/vmd/config.c

index 9745615..922e6cc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: config.c,v 1.67 2023/01/28 14:40:53 dv Exp $  */
+/*     $OpenBSD: config.c,v 1.68 2023/02/22 10:04:45 mbuhl Exp $       */
 
 /*
  * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -547,7 +547,7 @@ int
 config_getvm(struct privsep *ps, struct imsg *imsg)
 {
        struct vmop_create_params        vmc;
-       struct vmd_vm                   *vm;
+       struct vmd_vm                   *vm = NULL;
 
        IMSG_SIZE_CHECK(imsg, &vmc);
        memcpy(&vmc, imsg->data, sizeof(vmc));