From owner-svn-src-head@freebsd.org Tue Sep 29 04:47:32 2015 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 BA555A0A23C; Tue, 29 Sep 2015 04:47:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 AB3981CDD; Tue, 29 Sep 2015 04:47:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8T4lWfK074245; Tue, 29 Sep 2015 04:47:32 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8T4lWjl074244; Tue, 29 Sep 2015 04:47:32 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509290447.t8T4lWjl074244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 29 Sep 2015 04:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288351 - head/lib/libc/gen 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.20 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: Tue, 29 Sep 2015 04:47:32 -0000 Author: delphij Date: Tue Sep 29 04:47:31 2015 New Revision: 288351 URL: https://svnweb.freebsd.org/changeset/base/288351 Log: Use calloc() instead of malloc + memset. MFC after: 2 weeks Modified: head/lib/libc/gen/fts-compat.c Modified: head/lib/libc/gen/fts-compat.c ============================================================================== --- head/lib/libc/gen/fts-compat.c Tue Sep 29 03:40:21 2015 (r288350) +++ head/lib/libc/gen/fts-compat.c Tue Sep 29 04:47:31 2015 (r288351) @@ -137,9 +137,8 @@ __fts_open_44bsd(char * const *argv, int } /* Allocate/initialize the stream. */ - if ((priv = malloc(sizeof(*priv))) == NULL) + if ((priv = calloc(1, sizeof(*priv))) == NULL) return (NULL); - memset(priv, 0, sizeof(*priv)); sp = &priv->ftsp_fts; sp->fts_compar = compar; sp->fts_options = options;