qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] qdev-monitor: Fix use after free on duplicate device ID erro


From: Damien Hedde
Subject: Re: [PATCH] qdev-monitor: Fix use after free on duplicate device ID error
Date: Wed, 3 Nov 2021 10:25:44 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2


On 11/3/21 08:38, Markus Armbruster wrote:
Fixes: 4a1d937796de0fecd8b22d7dbebf87f38e8282fd
Reported-by: Coverity CID 1465223
Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>

Thanks,
Damien
---
  softmmu/qdev-monitor.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index e49d9773d2..14c1fb76c5 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -592,8 +592,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 {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]