syslogd: don't leak f
on failure in cfline(..)
Free `f` if an unknown priority or facility is parsed with the function. MFC after: 1 week Reported by: Coverity CID: 1368068 Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
b49d92c2aa
commit
4863f2fc55
@ -2117,6 +2117,7 @@ cfline(const char *line, const char *prog, const char *host)
|
||||
(void)snprintf(ebuf, sizeof ebuf,
|
||||
"unknown priority name \"%s\"", buf);
|
||||
logerror(ebuf);
|
||||
free(f);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
@ -2147,6 +2148,7 @@ cfline(const char *line, const char *prog, const char *host)
|
||||
"unknown facility name \"%s\"",
|
||||
buf);
|
||||
logerror(ebuf);
|
||||
free(f);
|
||||
return (NULL);
|
||||
}
|
||||
f->f_pmask[i >> 3] = pri;
|
||||
|
Loading…
Reference in New Issue
Block a user