Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jun 2013 21:29:03 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r252044 - stable/9/usr.sbin/kldxref
Message-ID:  <201306202129.r5KLT387084039@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Thu Jun 20 21:29:03 2013
New Revision: 252044
URL: http://svnweb.freebsd.org/changeset/base/252044

Log:
  MFC r251440: use calloc().

Modified:
  stable/9/usr.sbin/kldxref/ef_obj.c
Directory Properties:
  stable/9/usr.sbin/kldxref/   (props changed)

Modified: stable/9/usr.sbin/kldxref/ef_obj.c
==============================================================================
--- stable/9/usr.sbin/kldxref/ef_obj.c	Thu Jun 20 21:19:47 2013	(r252043)
+++ stable/9/usr.sbin/kldxref/ef_obj.c	Thu Jun 20 21:29:03 2013	(r252044)
@@ -343,7 +343,7 @@ ef_obj_open(const char *filename, struct
 	if ((fd = open(filename, O_RDONLY)) == -1)
 		return errno;
 
-	ef = malloc(sizeof(*ef));
+	ef = calloc(1, sizeof(*ef));
 	if (ef == NULL) {
 		close(fd);
 		return (ENOMEM);
@@ -352,7 +352,6 @@ ef_obj_open(const char *filename, struct
 	efile->ef_ef = ef;
 	efile->ef_ops = &ef_obj_file_ops;
 
-	bzero(ef, sizeof(*ef));
 	ef->ef_verbose = verbose;
 	ef->ef_fd = fd;
 	ef->ef_name = strdup(filename);



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