summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2015-01-21 13:03:18 +0000
committerrrs <rrs@FreeBSD.org>2015-01-21 13:03:18 +0000
commitb4a285552ce98cadf6aebe324bb52b79e6f8a9f8 (patch)
tree734f3f96a7115847718366203d47890e372bfcdb /usr.sbin
parent62e65f40de0cda6f2f78e3775e559f18ad51ff4e (diff)
downloadFreeBSD-src-b4a285552ce98cadf6aebe324bb52b79e6f8a9f8.zip
FreeBSD-src-b4a285552ce98cadf6aebe324bb52b79e6f8a9f8.tar.gz
Fix minor errors found by coverity. Thanks Gleb for
the pointers to the email!
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pmcstudy/pmcstudy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/pmcstudy/pmcstudy.c b/usr.sbin/pmcstudy/pmcstudy.c
index 6547489..a99d59a 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);
OpenPOWER on IntegriCloud