Date: Sun, 30 Dec 2001 17:31:25 +0200 From: Sheldon Hearn <sheldonh@starjuice.net> To: Peter Sanchez <fut0n@linuxforlesbians.org> Cc: freebsd-bugs@freebsd.org Subject: Re: bin/32807: which utility replacement in C Message-ID: <92274.1009726285@axl.seasidesoftware.co.za> In-Reply-To: Your message of "Sun, 30 Dec 2001 08:21:50 MST." <20011230082150.C17916@sushi.linuxforlesbians.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 30 Dec 2001 08:21:50 MST, Peter Sanchez wrote: > LOL. Im the one being killed over here ;) This is nothing. :-) Wait 'til DES tries to replace known-good code with new code. There's always at least one that complains. > > Note that there's a malloc() that isn't tested for failure, but it's > > hidden in a strdup(). This is in findprog(). > > Here ya go... Try this instead: if (strchr(prog, '/')) { tmpbuf = strdup(prog); } else { tmpbuf = malloc(strlen(all->path) + (strlen(prog) + 1)); if (tmpbuf != NULL) sprintf(tmpbuf, "%s/%s", all->path, prog); } if (tmpbuf == NULL) { losepath(); err(EX_OSERR, (char *)NULL); /* NOTREACHED */ } Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?92274.1009726285>