OSDN Git Service

parallels: fix memory leak in parallels_open()
authorDenis V. Lunev <den@openvz.org>
Mon, 18 Sep 2023 18:00:40 +0000 (20:00 +0200)
committerDenis V. Lunev <den@openvz.org>
Thu, 21 Sep 2023 06:45:32 +0000 (08:45 +0200)
We should free opts allocated through qemu_opts_create() at the end.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
block/parallels.c

index 428f72d..af7be42 100644 (file)
@@ -1217,6 +1217,7 @@ fail_format:
 fail_options:
     ret = -EINVAL;
 fail:
+    qemu_opts_del(opts);
     /*
      * "s" object was allocated by g_malloc0 so we can safely
      * try to free its fields even they were not allocated.