From owner-svn-src-head@freebsd.org Mon Aug 10 21:40: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 79AF899E638 for ; Mon, 10 Aug 2015 21:40:32 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BE1814E for ; Mon, 10 Aug 2015 21:40:32 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by oio137 with SMTP id 137so92694057oio.0 for ; Mon, 10 Aug 2015 14:40:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=r66z6o6hYhoy9AuwhRT35kofItzDLJlwdL5Y0a+63hI=; b=jeRFunkPFOgjH+8+lVIFDGDKrvlQildWniE7Fw2rpwDo8lvZSZc/6ES8q0Huy/M1/1 pewomDfWCaUPhC7umBsRBZ8buAjgvH054BI32WjvoAyqWvvVcUEtx5wK258Ys/u9YOnQ /7XkbhZZAwGQkk5KJ9BU2sW790agcuO+IXXATk1X6WARsBu4gmoVxiEN6lREtox3nfbF t5mXRjhkjmYkceVhLDtncpYjGaZUyzyhOOMVUhVh8r3EGtrrVgW/Bf1sene85nq0AqcR vYLpzyGGB0NOaOGQy+QfDr+mrC5JXmSEXtgEtwu6JsjdNS2RVofoaJXQhMNwKvTvSIuc CUbw== X-Gm-Message-State: ALoCoQl8auGejFE4zijAk0MFetISjx33x4zspfz5jsi+KZKGU38zvj5y1F0K7jHX0KBaOLBFRcrf MIME-Version: 1.0 X-Received: by 10.202.229.204 with SMTP id c195mr6301369oih.113.1439242825085; Mon, 10 Aug 2015 14:40:25 -0700 (PDT) Received: by 10.76.50.84 with HTTP; Mon, 10 Aug 2015 14:40:25 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <201508102131.t7ALVo5J050735@repo.freebsd.org> References: <201508102131.t7ALVo5J050735@repo.freebsd.org> Date: Mon, 10 Aug 2015 23:40:25 +0200 Message-ID: Subject: Re: svn commit: r286601 - head/usr.bin/patch From: Ed Schouten To: Xin LI Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 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: Mon, 10 Aug 2015 21:40:32 -0000 Hi Xin, 2015-08-10 23:31 GMT+02:00 Xin LI : > + argp[0] = strdup(RCSDIFF); > + argp[1] = strdup(filename); > ... > + free(argp[1]); > + free(argp[0]); > + argp[0] = strdup(CHECKOUT); > + argp[1] = strdup("-l"); > + argp[2] = strdup(filename); > ... > + free(argp[2]); > + free(argp[1]); > + free(argp[0]); There's no need to call strdup() here, right? As far as I know, execve() and posix_spawn() don't modify the arguments/environment. These functions should use "const char *const *" as its argument type, but that cannot be used, as it would cause compiler errors if "char **" is passed in. See the table close to the bottom of this article: http://pubs.opengroup.org/onlinepubs/9699919799/functions/execve.html -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717