'g_strdup()' is NULL-tolerant.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
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