XDR xdr;
struct remote_thread_call *thiscall;
remote_message_header hdr;
+ int ret;
memset(&hdr, 0, sizeof hdr);
}
xdr_destroy (&xdr);
- /* remoteIO frees 'thiscall' for us (XXX that's dubious semantics) */
- if (remoteIO(st->conn, priv, 0, thiscall) < 0)
+ ret = remoteIO(st->conn, priv, 0, thiscall);
+ VIR_FREE(thiscall);
+ if (ret < 0)
return -1;
return nbytes;
if (!privst->incomingOffset) {
struct remote_thread_call *thiscall;
+ int ret;
if (VIR_ALLOC(thiscall) < 0) {
virReportOOMError();
goto cleanup;
}
- /* remoteIO frees 'thiscall' for us (XXX that's dubious semantics) */
- if (remoteIO(st->conn, priv, 0, thiscall) < 0)
+ ret = remoteIO(st->conn, priv, 0, thiscall);
+ VIR_FREE(thiscall);
+ if (ret < 0)
goto cleanup;
}
remoteError(VIR_ERR_INTERNAL_ERROR,
_("failed to wake up polling thread: %s"),
virStrerror(errno, errout, sizeof errout));
- VIR_FREE(thiscall);
return -1;
} else if (s != sizeof(ignore)) {
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to wake up polling thread"));
- VIR_FREE(thiscall);
return -1;
}
}
remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to wait on condition"));
- VIR_FREE(thiscall);
return -1;
}
if (priv->watch >= 0)
virEventUpdateHandle(priv->watch, VIR_EVENT_HANDLE_READABLE);
- if (rv < 0) {
- VIR_FREE(thiscall);
+ if (rv < 0)
return -1;
- }
cleanup:
DEBUG("All done with our call %d %p %p", thiscall->proc_nr, priv->waitDispatch, thiscall);
} else {
rv = 0;
}
- VIR_FREE(thiscall);
return rv;
}
xdrproc_t ret_filter, char *ret)
{
struct remote_thread_call *thiscall;
+ int rv;
thiscall = prepareCall(priv, flags, proc_nr, args_filter, args,
ret_filter, ret);
return -1;
}
- return remoteIO(conn, priv, flags, thiscall);
+ rv = remoteIO(conn, priv, flags, thiscall);
+ VIR_FREE(thiscall);
+ return rv;
}