const char *object,
char ***props)
{
- int ret = -1;
- virJSONValue *cmd;
- virJSONValue *reply = NULL;
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
*props = NULL;
return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
- goto cleanup;
+ return -1;
- if (qemuMonitorJSONHasError(reply, "DeviceNotFound")) {
- ret = 0;
- goto cleanup;
- }
+ if (qemuMonitorJSONHasError(reply, "DeviceNotFound"))
+ return 0;
- ret = qemuMonitorJSONParsePropsList(cmd, reply, NULL, props);
- cleanup:
- virJSONValueFree(reply);
- virJSONValueFree(cmd);
- return ret;
+ return qemuMonitorJSONParsePropsList(cmd, reply, NULL, props);
}