Fix the resource leak of a 'FILE *' which could happen in routine
ctl_readcf() if a call to malloc failed. PR: 204955 Reported by: David Binderman
This commit is contained in:
parent
df5f14797b
commit
02e8b7b2e7
@ -292,8 +292,10 @@ ctl_readcf(const char *ptrname, const char *cfname)
|
||||
msize = sroom2 + CTI_LINEMAX;
|
||||
msize = roundup(msize, 8);
|
||||
cstart = malloc(msize);
|
||||
if (cstart == NULL)
|
||||
if (cstart == NULL) {
|
||||
fclose(cfile);
|
||||
return NULL;
|
||||
}
|
||||
memset(cstart, 0, msize);
|
||||
cpriv = (struct cjprivate *)cstart;
|
||||
cpriv->pub.cji_priv = cpriv;
|
||||
|
Loading…
Reference in New Issue
Block a user