The return value was not properly checked in the code for input type
evdev.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_command.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 45278c7108..483041f584 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4336,13 +4336,15 @@ qemuBuildInputEvdevProps(virDomainInputDef *dev)
NULL) < 0)
return NULL;
- if (dev->source.grab == VIR_DOMAIN_INPUT_SOURCE_GRAB_ALL)
- virJSONValueObjectAdd(props, "b:grab_all", true, NULL);
+ if (dev->source.grab == VIR_DOMAIN_INPUT_SOURCE_GRAB_ALL &&
+ virJSONValueObjectAdd(props, "b:grab_all", true, NULL) < 0)
+ return NULL;
- if (dev->source.grabToggle != VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_DEFAULT)
+ if (dev->source.grabToggle != VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_DEFAULT
&&
virJSONValueObjectAdd(props, "s:grab-toggle",
virDomainInputSourceGrabToggleTypeToString(dev->source.grabToggle),
- NULL);
+ NULL) < 0)
+ return NULL;
return g_steal_pointer(&props);
}
--
2.33.1