diff options
author | emaste <emaste@FreeBSD.org> | 2015-07-24 19:09:11 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-07-24 19:09:11 +0000 |
commit | 099a5eb8d8f9a1b1ea9551557868f5e511dbf8c2 (patch) | |
tree | d005f767adf94f890f1c6040f3280cb5dc28b027 | |
parent | 27addd8a727574e31744bded9b8a64917b6cb69b (diff) | |
download | FreeBSD-src-099a5eb8d8f9a1b1ea9551557868f5e511dbf8c2.zip FreeBSD-src-099a5eb8d8f9a1b1ea9551557868f5e511dbf8c2.tar.gz |
MFC r277485 by rrs: Fix minor errors found by coverity.
PR: 201594
Sponsored by: The FreeBSD Foundation
-rw-r--r-- | usr.sbin/pmcstudy/pmcstudy.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/pmcstudy/pmcstudy.c b/usr.sbin/pmcstudy/pmcstudy.c index bb577b9..ffe1c58 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); |