From owner-svn-src-head@freebsd.org Mon Jan 9 06:03:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF2BBCA5D19; Mon, 9 Jan 2017 06:03:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A152E1E9F; Mon, 9 Jan 2017 06:03:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0963nIB008436; Mon, 9 Jan 2017 06:03:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0963nCc008435; Mon, 9 Jan 2017 06:03:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701090603.v0963nCc008435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 9 Jan 2017 06:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311754 - head/contrib/bsnmp/gensnmpdef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:03:50 -0000 Author: ngie Date: Mon Jan 9 06:03:49 2017 New Revision: 311754 URL: https://svnweb.freebsd.org/changeset/base/311754 Log: Use calloc instead of malloc + memset(.., 0, ..) MFC after: 5 days Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c ============================================================================== --- head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 05:58:48 2017 (r311753) +++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 06:03:49 2017 (r311754) @@ -399,12 +399,11 @@ static void save_typdef(char *name) { struct tdef *t; - t = malloc(sizeof(struct tdef)); + t = calloc(1, sizeof(struct tdef)); if (t == NULL) err(1, NULL); - memset(t, 0 , sizeof(struct tdef)); t->name = name; SLIST_INSERT_HEAD(&tdefs, t, link); }