From owner-svn-src-head@freebsd.org Sat May 27 23:57:10 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 BDBA0D84D34; Sat, 27 May 2017 23:57:10 +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 8DF5B1383; Sat, 27 May 2017 23:57:10 +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 v4RNv9DA078143; Sat, 27 May 2017 23:57:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4RNv9Vb078142; Sat, 27 May 2017 23:57:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705272357.v4RNv9Vb078142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 27 May 2017 23:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319015 - head/tools/regression/geom_gpt 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: Sat, 27 May 2017 23:57:10 -0000 Author: ngie Date: Sat May 27 23:57:09 2017 New Revision: 319015 URL: https://svnweb.freebsd.org/changeset/base/319015 Log: Use calloc instead of malloc + memset MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/tools/regression/geom_gpt/gctl_test_helper.c Modified: head/tools/regression/geom_gpt/gctl_test_helper.c ============================================================================== --- head/tools/regression/geom_gpt/gctl_test_helper.c Sat May 27 23:31:59 2017 (r319014) +++ head/tools/regression/geom_gpt/gctl_test_helper.c Sat May 27 23:57:09 2017 (r319015) @@ -87,10 +87,9 @@ parse(char *arg, char **param, char **va return (EINVAL); if (*len <= 0 || *len > PATH_MAX) return (EINVAL); - *value = malloc(*len); + *value = calloc(*len, sizeof(char)); if (*value == NULL) return (ENOMEM); - memset(*value, 0, *len); if (equal != NULL) { if (strlen(equal) >= PATH_MAX) return (ENOMEM);