* src/virsh.c src/xen_internal.c src/xend_internal.c: memory leaks

fixed by a patch from Masayuki Sunou
Daniel
This commit is contained in:
Daniel Veillard 2007-05-29 13:55:19 +00:00
parent bb5fcd02bc
commit 7b88f59ce4
4 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Tue May 29 15:54:17 CEST 2007 Daniel Veillard <veillard@redhat.com>
* src/virsh.c src/xen_internal.c src/xend_internal.c: memory leaks
fixed by a patch from Masayuki Sunou
Wed May 23 16:07:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virsh.c: Add attach-device and detach-device commands to

View File

@ -3153,8 +3153,10 @@ vshCommandParse(vshControl * ctl, char *cmdstr)
c->def = cmd;
c->next = NULL;
if (!vshCommandCheckOpts(ctl, c))
if (!vshCommandCheckOpts(ctl, c)) {
if(c) free(c);
goto syntaxError;
}
if (!ctl->cmd)
ctl->cmd = c;

View File

@ -1497,11 +1497,15 @@ xenHypervisorInit(void)
virXenError(VIR_ERR_XEN_CALL, " ioctl ", IOCTL_PRIVCMD_HYPERCALL);
close(fd);
in_init = 0;
if (ipt)
free(ipt);
return(-1);
done:
close(fd);
in_init = 0;
if (ipt)
free(ipt);
return(0);
}

View File

@ -3072,7 +3072,7 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc,
static int
xenDaemonAttachDevice(virDomainPtr domain, char *xml)
{
char *sexpr, *conf;
char *sexpr, *conf, *str;
int hvm = 0, ret;
xenUnifiedPrivatePtr priv;
@ -3084,8 +3084,11 @@ xenDaemonAttachDevice(virDomainPtr domain, char *xml)
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (strcmp(virDomainGetOSType(domain), "linux"))
str = virDomainGetOSType(domain);
if (strcmp(str, "linux"))
hvm = 1;
if (str)
free(str);
sexpr = virParseXMLDevice(domain->conn, xml, hvm, priv->xendConfigVersion);
if (sexpr == NULL)
return (-1);