Do not leak PMC_PO_OWNS_LOGFILE on error.
Note that PMCLOG_RESERVE_WITH_ERROR() macro contains goto error; statement and executed after the flag is set. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
c9da263712
commit
f4dd123e15
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325759
@ -683,6 +683,7 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd)
|
||||
(void) fdrop(po->po_file, curthread);
|
||||
po->po_file = NULL; /* clear file and error state */
|
||||
po->po_error = 0;
|
||||
po->po_flags &= ~PMC_PO_OWNS_LOGFILE;
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user