Bug 201594 - usr/src/usr.sbin/pmcstudy/pmcstudy.c:2047: pointless memset ?
Summary: usr/src/usr.sbin/pmcstudy/pmcstudy.c:2047: pointless memset ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.2-BETA1
Hardware: Any Any
: --- Affects Only Me
Assignee: Randall Stewart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-15 16:35 UTC by David Binderman
Modified: 2015-07-24 19:38 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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