Author: cwittich
Date: Thu Mar 18 07:34:39 2010
New Revision: 46257
URL:
http://svn.reactos.org/svn/reactos?rev=46257&view=rev
Log:
fix memory leak on error path
Modified:
trunk/tools/sysreg2/virt.c
Modified: trunk/tools/sysreg2/virt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/sysreg2/virt.c?rev=46257&…
==============================================================================
--- trunk/tools/sysreg2/virt.c [iso-8859-1] (original)
+++ trunk/tools/sysreg2/virt.c [iso-8859-1] Thu Mar 18 07:34:39 2010
@@ -137,6 +137,7 @@
if (virDomainCreate(vDomPtr) != 0)
{
virDomainUndefine(vDomPtr);
+ virDomainFree(vDomPtr);
vDomPtr = NULL;
}
else
@@ -189,7 +190,7 @@
/* SysregPrintf("Error: Virtual Machine is already running.\n");
goto cleanup; */
system("virsh destroy ReactOS");
- usleep(1000);
+ usleep(1000);
}
/* If the HD image already exists, delete it */