Memory leak of the remoteDomainSet* functions

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]