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
1 changed files with 2 additions and 0 deletions

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);