[PATCH 04/27] qemuMonitorJSONQueryFdsetsParse: Don't check value passed to g_strdup

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

 



'g_strdup()' is NULL-tolerant.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_monitor_json.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 8e1501d91f..69ecc8a2d1 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -3695,7 +3695,6 @@ qemuMonitorJSONQueryFdsetsParse(virJSONValue *msg,

     for (i = 0; i < ninfo; i++) {
         size_t j;
-        const char *tmp;
         virJSONValue *fdarray;
         qemuMonitorFdsetInfo *fdsetinfo = &sets->fdsets[i];

@@ -3734,9 +3733,7 @@ qemuMonitorJSONQueryFdsetsParse(virJSONValue *msg,
             }

             /* opaque is optional and may be missing */
-            tmp = virJSONValueObjectGetString(fdentry, "opaque");
-            if (tmp)
-                fdinfo->opaque = g_strdup(tmp);
+            fdinfo->opaque = g_strdup(virJSONValueObjectGetString(fdentry, "opaque"));
         }
     }

-- 
2.34.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux