Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jan 2015 13:03:19 +0000 (UTC)
From:      Randall Stewart <rrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r277485 - head/usr.sbin/pmcstudy
Message-ID:  <201501211303.t0LD3JM4092968@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rrs
Date: Wed Jan 21 13:03:18 2015
New Revision: 277485
URL: https://svnweb.freebsd.org/changeset/base/277485

Log:
  Fix minor errors found by coverity. Thanks Gleb for
  the pointers to the email!

Modified:
  head/usr.sbin/pmcstudy/pmcstudy.c

Modified: head/usr.sbin/pmcstudy/pmcstudy.c
==============================================================================
--- head/usr.sbin/pmcstudy/pmcstudy.c	Wed Jan 21 10:47:28 2015	(r277484)
+++ head/usr.sbin/pmcstudy/pmcstudy.c	Wed Jan 21 13:03:18 2015	(r277485)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501211303.t0LD3JM4092968>