diff --git a/blockdev.c b/blockdev.c index ad436488b7..2f441c5343 100644 --- a/blockdev.c +++ b/blockdev.c @@ -224,9 +224,7 @@ void drive_info_del(DriveInfo *dinfo) if (!dinfo) { return; } - if (dinfo->opts) { - qemu_opts_del(dinfo->opts); - } + qemu_opts_del(dinfo->opts); g_free(dinfo->id); QTAILQ_REMOVE(&drives, dinfo, next); g_free(dinfo->serial); diff --git a/qemu-img.c b/qemu-img.c index ea4bbae546..27b85dbda4 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1736,9 +1736,7 @@ out: qemu_opts_del(opts); qemu_opts_free(create_opts); qemu_vfree(buf); - if (sn_opts) { - qemu_opts_del(sn_opts); - } + qemu_opts_del(sn_opts); if (out_bs) { bdrv_unref(out_bs); } diff --git a/qemu-nbd.c b/qemu-nbd.c index fa603382d4..b524b3420f 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -778,9 +778,7 @@ int main(int argc, char **argv) unlink(sockpath); } - if (sn_opts) { - qemu_opts_del(sn_opts); - } + qemu_opts_del(sn_opts); if (device) { void *ret;