[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] Memory leak of the remoteDomainSet* functions



Hello, there

Per bug https://bugzilla.redhat.com/show_bug.cgi?id=725322, should
we change the remoteDomainSet* functions into "skipgen", and fix the
leaks like below? (NB, new VIR_FREE statements)

static int
remoteDomainSetBlkioParameters(virDomainPtr dom,
virTypedParameterPtr params,
int nparams,
unsigned int flags)
{
int rv = -1;
int i;
struct private_data *priv = dom->conn->privateData;
remote_domain_set_blkio_parameters_args args;
remote_domain_set_blkio_parameters_args args;

remoteDriverLock(priv);

make_nonnull_domain(&args.dom, dom);
args.flags = flags;

if (remoteSerializeTypedParameters(params,
nparams,
&args.params.params_val,
&args.params.params_len) < 0) {
for (i = 0; i < nparams; i++) {
VIR_FREE(args.params.params_val[i].field);
}
VIR_FREE(args.params.params_val);
xdr_free((xdrproc_t)xdr_remote_domain_set_blkio_parameters_args, (char
*)&args);
goto done;
}

if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_SET_BLKIO_PARAMETERS,
(xdrproc_t)xdr_remote_domain_set_blkio_parameters_args, (char *)&args,
(xdrproc_t)xdr_void, (char *)NULL) == -1) {
goto done;
}

rv = 0;

done:
if (args.params.params_val) {
for (i = 0; i < nparams; i++) {
VIR_FREE(args.params.params_val[i].field);
}
VIR_FREE(args.params.params_val);
}
remoteDriverUnlock(priv);
return rv;
}

Regards,
Osier


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]