From 8a3bbeb234955c5c3f748edcb306a12252bf8edb Mon Sep 17 00:00:00 2001 From: Randall Stewart Date: Wed, 21 Jan 2015 13:03:18 +0000 Subject: [PATCH] Fix minor errors found by coverity. Thanks Gleb for the pointers to the email! --- 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 6547489f430b..a99d59a8cb33 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);