xmlwf: Checks value after calling malloc

This commit is contained in:
Kleber Tarcísio 2020-06-22 11:15:12 -03:00 committed by Sebastian Pipping
parent a76fd99bf7
commit 12a7276f3e

View File

@ -1051,6 +1051,10 @@ tmain(int argc, XML_Char **argv) {
}
outName = (XML_Char *)malloc((tcslen(outputDir) + tcslen(file) + 2)
* sizeof(XML_Char));
if (! outName) {
tperror(T("Could not allocate memory"));
exit(1);
}
tcscpy(outName, outputDir);
tcscat(outName, delim);
tcscat(outName, file);