Date: Mon, 10 Aug 2015 23:40:25 +0200 From: Ed Schouten <ed@nuxi.nl> To: Xin LI <delphij@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286601 - head/usr.bin/patch Message-ID: <CABh_MKk5uOupQx9farP3_5D1J0f-5fAt0EXqnhautx0TNm9AaA@mail.gmail.com> In-Reply-To: <201508102131.t7ALVo5J050735@repo.freebsd.org> References: <201508102131.t7ALVo5J050735@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Xin,
2015-08-10 23:31 GMT+02:00 Xin LI <delphij@freebsd.org>:
> + 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 <ed@nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CABh_MKk5uOupQx9farP3_5D1J0f-5fAt0EXqnhautx0TNm9AaA>
