From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 03:44:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 979DCD58; Sun, 3 Feb 2013 03:44:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8ABD92F0; Sun, 3 Feb 2013 03:44:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r133i0KC017765; Sun, 3 Feb 2013 03:44:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r133i0kl017764; Sun, 3 Feb 2013 03:44:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030344.r133i0kl017764@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 03:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246280 - stable/9/usr.sbin/pw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 03:44:00 -0000 Author: eadler Date: Sun Feb 3 03:43:59 2013 New Revision: 246280 URL: http://svnweb.freebsd.org/changeset/base/246280 Log: MFC r243896: Use strdup instead of malloc + strcpy Approved by: cperciva (mentor, implicit) Modified: stable/9/usr.sbin/pw/pwupd.c Directory Properties: stable/9/usr.sbin/pw/ (props changed) Modified: stable/9/usr.sbin/pw/pwupd.c ============================================================================== --- stable/9/usr.sbin/pw/pwupd.c Sun Feb 3 03:38:44 2013 (r246279) +++ stable/9/usr.sbin/pw/pwupd.c Sun Feb 3 03:43:59 2013 (r246280) @@ -53,12 +53,10 @@ setpwdir(const char * dir) { if (dir == NULL) return -1; - else { - char * d = malloc(strlen(dir)+1); - if (d == NULL) - return -1; - pwpath = strcpy(d, dir); - } + else + pwpath = strdup(dir); + if (pwpath == NULL) + return -1; return 0; }