From Eric Sesterhenn via bug 4175:

Fixed fp leakage in error path.

svn path=/trunk/; revision=30757
This commit is contained in:
Stig Bjørlykke 2009-10-29 11:23:04 +00:00
parent 71b719df07
commit fd1a8138cb
1 changed files with 2 additions and 0 deletions

View File

@ -2575,6 +2575,7 @@ void Parse(struct lemon *gp)
if( filebuf==0 ){
ErrorMsg(ps.filename,0,"Can't allocate %ld of memory to hold this file.",
filesize+1);
fclose(fp);
gp->errorcnt++;
return;
}
@ -2582,6 +2583,7 @@ void Parse(struct lemon *gp)
ErrorMsg(ps.filename,0,"Can't read in all %ld bytes of this file.",
filesize);
free(filebuf);
fclose(fp);
gp->errorcnt++;
return;
}