diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2021-11-02 16:33:42 +0000 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-11-11 03:13:05 -0500 |
commit | b66cecb238d065628b85a18357d28d21618a4580 (patch) | |
tree | 08b691bc04bec9002f245e485c8b3dafdd69cb44 /softmmu | |
parent | cd523a4181b152004fc0aed18381aefe600ac38e (diff) | |
download | qemu-b66cecb238d065628b85a18357d28d21618a4580.zip qemu-b66cecb238d065628b85a18357d28d21618a4580.tar.gz qemu-b66cecb238d065628b85a18357d28d21618a4580.tar.bz2 |
softmmu/qdev-monitor: fix use-after-free in qdev_set_id()
Reported by Coverity (CID 1465222).
Fixes: 4a1d937796de0fecd8b22d7dbebf87f38e8282fd ("softmmu/qdev-monitor: add error handling in qdev_set_id")
Cc: Damien Hedde <damien.hedde@greensocs.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20211102163342.31162-1-stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r-- | softmmu/qdev-monitor.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index f8b3a4c..588a62b 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -593,8 +593,8 @@ const char *qdev_set_id(DeviceState *dev, char *id, Error **errp) if (prop) { dev->id = id; } else { - g_free(id); error_setg(errp, "Duplicate device ID '%s'", id); + g_free(id); return NULL; } } else { |