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:
Konstantin Belousov 2017-11-13 10:45:31 +00:00
parent c9da263712
commit f4dd123e15
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325759

View File

@ -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);
}