svn commit: r252044 - stable/9/usr.sbin/kldxref
Xin LI
delphij at FreeBSD.org
Thu Jun 20 21:29:04 UTC 2013
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);
More information about the svn-src-stable-9
mailing list