const char *opaque,
qemuMonitorAddFdInfoPtr fdinfo)
{
- virJSONValuePtr args = NULL;
+ g_autoptr(virJSONValue) args = NULL;
g_autoptr(virJSONValue) reply = NULL;
g_autoptr(virJSONValue) cmd = NULL;
if (virJSONValueObjectAdd(args, "j:fdset-id", fdset, NULL) < 0)
return -1;
- if (!(cmd = qemuMonitorJSONMakeCommandInternal("add-fd", args)))
+ if (!(cmd = qemuMonitorJSONMakeCommandInternal("add-fd", g_steal_pointer(&args))))
return -1;
if (qemuMonitorJSONCommandWithFd(mon, cmd, fd, &reply) < 0)