Author: cwittich
Date: Mon Oct 8 02:43:18 2007
New Revision: 29446
URL:
http://svn.reactos.org/svn/reactos?rev=29446&view=rev
Log:
fix some memory leaks
Modified:
trunk/reactos/tools/buildno/buildno.cpp
trunk/reactos/tools/xml.cpp
Modified: trunk/reactos/tools/buildno/buildno.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/buildno/buildno.cpp?…
==============================================================================
--- trunk/reactos/tools/buildno/buildno.cpp (original)
+++ trunk/reactos/tools/buildno/buildno.cpp Mon Oct 8 02:43:18 2007
@@ -260,6 +260,7 @@
if (memcmp(s1, orig, length) == 0)
{
fclose(h);
+ free(s1);
return;
}
}
@@ -273,6 +274,7 @@
"%s: can not create file \"%s\"!\n",
argv0,
filename);
+ free(s1);
return;
}
fwrite(s1, 1, strlen(s1), h);
@@ -412,6 +414,8 @@
printf ("%s: no code generated", argv [0]);
}
+ free(kernel_version_build_type);
+
return EXIT_SUCCESS;
}
Modified: trunk/reactos/tools/xml.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/xml.cpp?rev=29446&am…
==============================================================================
--- trunk/reactos/tools/xml.cpp (original)
+++ trunk/reactos/tools/xml.cpp Mon Oct 8 02:43:18 2007
@@ -860,6 +860,7 @@
if ( !f->open ( filename ) )
{
+ delete f;
throw XMLFileNotFoundException ( "(virtual)", filename );
return NULL;
}
@@ -884,6 +885,7 @@
{
string location = e->location;
delete e;
+ delete f;
throw XMLException ( location, "internal tool error: xi:include doesn't have
a parent" );
return NULL;
}
@@ -899,6 +901,7 @@
{
string location = e->location;
delete e;
+ delete f;
throw XMLException ( location, "internal tool error: couldn't find xi:include
in parent's sub-elements" );
return NULL;
}
@@ -910,6 +913,7 @@
e->attributes.resize ( 0 );
delete e;
}
+ delete f;
return head;
}