parseBatInfo: check line for NULL before passing it to String_getToken()

This commit is contained in:
Jan Chren (rindeal) 2017-05-06 01:25:20 +02:00 committed by Hisham Muhammad
parent b84ebfd4e8
commit b0588d90ff

View File

@ -72,6 +72,8 @@ static unsigned long int parseBatInfo(const char *fileName, const unsigned short
fclose(file);
if (!line) break;
char *foundNumStr = String_getToken(line, wordNum);
const unsigned long int foundNum = atoi(foundNumStr);
free(foundNumStr);