[REGTESTS2XML]

Fix memory leaks

svn path=/trunk/; revision=53762
This commit is contained in:
Pierre Schweitzer 2011-09-19 17:24:01 +00:00
parent 2e6e9dd622
commit 0d3839a28a

View file

@ -81,7 +81,6 @@ convert_path(char* origpath)
static void
write_line(char *line)
{
int n_out;
char buf[200];
memset(buf, 0, sizeof(buf));
@ -90,7 +89,7 @@ write_line(char *line)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
generate_xml();
free(input_file);
free(output_file);
fclose(out);
return 0;