Fix double frees in ecpg.

Patch by Patrick Krecker <patrick@judicata.com>
This commit is contained in:
Michael Meskes 2018-03-14 00:47:49 +01:00
parent 1e22166e5e
commit db2fc801f6
1 changed files with 4 additions and 1 deletions

View File

@ -327,6 +327,7 @@ main(int argc, char *const argv[])
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
progname, output_filename, strerror(errno));
free(output_filename);
output_filename = NULL;
free(input_filename);
continue;
}
@ -474,8 +475,10 @@ main(int argc, char *const argv[])
}
}
if (output_filename && out_option == 0)
if (output_filename && out_option == 0) {
free(output_filename);
output_filename = NULL;
}
free(input_filename);
}