lemon: add free() to avoid mem leak (CID 1309088)

Change-Id: Id32864d324f72ffee9c1033f0f36a79eb2651334
Reviewed-on: https://code.wireshark.org/review/10797
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Dario Lombardo 2015-10-05 11:55:09 +02:00 committed by Michael Mann
parent a77d3db9fe
commit 24b5300411
1 changed files with 2 additions and 1 deletions

View File

@ -2707,9 +2707,10 @@ void Parse(struct lemon *gp)
filesize = ftell(fp);
rewind(fp);
filebuf = (char *)malloc( filesize+1 );
if( filesize>100000000 || filebuf==0 ){
if( filesize>100000000 || filebuf==NULL ){
ErrorMsg(ps.filename,0,"Input file too large.");
gp->errorcnt++;
free(filebuf);
fclose(fp);
return;
}