Author: pschweitzer
Date: Mon Sep 19 17:24:01 2011
New Revision: 53762
URL:
http://svn.reactos.org/svn/reactos?rev=53762&view=rev
Log:
[REGTESTS2XML]
Fix memory leaks
Modified:
trunk/reactos/tools/regtests2xml/regtests2xml.c
Modified: trunk/reactos/tools/regtests2xml/regtests2xml.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/regtests2xml/regtest…
==============================================================================
--- trunk/reactos/tools/regtests2xml/regtests2xml.c [iso-8859-1] (original)
+++ trunk/reactos/tools/regtests2xml/regtests2xml.c [iso-8859-1] Mon Sep 19 17:24:01 2011
@@ -81,7 +81,6 @@
static void
write_line(char *line)
{
- int n_out;
char buf[200];
memset(buf, 0, sizeof(buf));
@@ -90,7 +89,7 @@
buf[strlen(buf)] = '\r';
buf[strlen(buf)] = '\n';
- n_out = fwrite(&buf[0], 1, strlen(buf), out);
+ (void)fwrite(&buf[0], 1, strlen(buf), out);
}
@@ -414,6 +413,7 @@
input_file = convert_path(argv[1]);
if (input_file[0] == 0)
{
+ free(input_file);
printf("Missing input-filename\n");
return 1;
}
@@ -421,6 +421,8 @@
output_file = convert_path(argv[2]);
if (output_file[0] == 0)
{
+ free(output_file);
+ free(input_file);
printf("Missing output-filename\n");
return 1;
}
@@ -428,6 +430,8 @@
out = fopen(output_file, "wb");
if (out == NULL)
{
+ free(input_file);
+ free(output_file);
printf("Cannot open output file");
return 1;
}
@@ -436,6 +440,8 @@
generate_xml();
+ free(input_file);
+ free(output_file);
fclose(out);
return 0;