From d9c5a3e1ad402e06a492e3b6a5eab17404765cc6 Mon Sep 17 00:00:00 2001 From: emaste Date: Fri, 24 Jul 2015 19:37:30 +0000 Subject: [PATCH] MFS r285849: Fix minor errors found by coverity. PR: 201594 Approved by: re (gjb) Sponsored by: The FreeBSD Foundation git-svn-id: https://svn.freebsd.org/base/releng/10.2@285853 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.sbin/pmcstudy/pmcstudy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pmcstudy/pmcstudy.c b/usr.sbin/pmcstudy/pmcstudy.c index bb577b99f..ffe1c5803 100644 --- a/usr.sbin/pmcstudy/pmcstudy.c +++ b/usr.sbin/pmcstudy/pmcstudy.c @@ -1808,6 +1808,9 @@ process_file(char *filename) if (cnts == NULL) { /* Nothing we can do */ printf("Nothing to do -- no counters built\n"); + if (io) { + fclose(io); + } return; } lace_cpus_together(); @@ -2044,7 +2047,7 @@ get_cpuid_set(void) printf("No memory3 allocation fails at startup?\n"); exit(-1); } - memset(more, sz, 0); + memset(more, 0, sz); memcpy(more, valid_pmcs, sz); pmc_allocated_cnt *= 2; free(valid_pmcs); -- 2.42.0