diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2015-02-22 14:45:00 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2015-02-22 14:45:00 +0000 |
commit | 62debcc7f351c7cab89ec6b23dfc7dc96005691b (patch) | |
tree | 537957707b1092ab20365cf2d877d53870801990 /usr.sbin/pmccontrol | |
parent | e220ce08ef93615addf20f152780e5a1d64b8e5e (diff) | |
download | src-62debcc7f351c7cab89ec6b23dfc7dc96005691b.tar.gz src-62debcc7f351c7cab89ec6b23dfc7dc96005691b.zip |
pmccontrol(8): Replace malloc() + memset() with calloc()
PMCC_OP_IGNORE happens to be zero, so just use calloc() here.
Notes
Notes:
svn path=/head/; revision=279156
Diffstat (limited to 'usr.sbin/pmccontrol')
-rw-r--r-- | usr.sbin/pmccontrol/pmccontrol.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/usr.sbin/pmccontrol/pmccontrol.c b/usr.sbin/pmccontrol/pmccontrol.c index b3585d042d13..c1e2acdefc35 100644 --- a/usr.sbin/pmccontrol/pmccontrol.c +++ b/usr.sbin/pmccontrol/pmccontrol.c @@ -147,11 +147,9 @@ pmcc_do_enable_disable(struct pmcc_op_list *op_list) if (npmc == 0) errx(EX_CONFIG, "No PMCs found"); - if ((map = malloc(npmc * ncpu)) == NULL) + if ((map = calloc(npmc, ncpu)) == NULL) err(EX_SOFTWARE, "Out of memory"); - (void) memset(map, PMCC_OP_IGNORE, npmc*ncpu); - error = 0; STAILQ_FOREACH(np, op_list, op_next) { |