Bug 201594

Summary: usr/src/usr.sbin/pmcstudy/pmcstudy.c:2047: pointless memset ?
Product: Base System Reporter: David Binderman <dcb314>
Component: miscAssignee: Randall Stewart <rrs>
Status: Closed FIXED    
Severity: Affects Only Me CC: emaste
Priority: ---    
Version: 10.2-BETA1   
Hardware: Any   
OS: Any   

Description David Binderman 2015-07-15 16:35:43 UTC
usr/src/usr.sbin/pmcstudy/pmcstudy.c:2047]: (warning) memset() called to fill 0 bytes of 'more'.

           more = malloc(sz);
            if (more == NULL) {
                printf("No memory3 allocation fails at startup?\n");
                exit(-1);
            }
            memset(more, sz, 0);

Suggest use calloc ?
Comment 1 Ed Maste freebsd_committer freebsd_triage 2015-07-19 18:37:22 UTC
Missing MFC it seems
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-07-24 19:09:41 UTC
A commit references this bug:

Author: emaste
Date: Fri Jul 24 19:09:12 UTC 2015
New revision: 285849
URL: https://svnweb.freebsd.org/changeset/base/285849

Log:
  MFC r277485 by rrs: Fix minor errors found by coverity.

  PR:		201594
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/10/
  stable/10/usr.sbin/pmcstudy/pmcstudy.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-07-24 19:37:45 UTC
A commit references this bug:

Author: emaste
Date: Fri Jul 24 19:37:31 UTC 2015
New revision: 285853
URL: https://svnweb.freebsd.org/changeset/base/285853

Log:
  MFS r285849: Fix minor errors found by coverity.

  PR:		201594
  Approved by:	re (gjb)
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  releng/10.2/
  releng/10.2/usr.sbin/pmcstudy/pmcstudy.c