From owner-freebsd-bugs Sun Dec 30 7:29:36 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from axl.seasidesoftware.co.za (axl.seasidesoftware.co.za [196.31.7.201]) by hub.freebsd.org (Postfix) with ESMTP id 8F56737B41B for ; Sun, 30 Dec 2001 07:29:32 -0800 (PST) Received: from sheldonh (helo=axl.seasidesoftware.co.za) by axl.seasidesoftware.co.za with local-esmtp (Exim 3.33 #1) id 16Khvp-000O0J-00; Sun, 30 Dec 2001 17:31:25 +0200 From: Sheldon Hearn To: Peter Sanchez Cc: freebsd-bugs@freebsd.org Subject: Re: bin/32807: which utility replacement in C In-reply-to: Your message of "Sun, 30 Dec 2001 08:21:50 MST." <20011230082150.C17916@sushi.linuxforlesbians.org> Date: Sun, 30 Dec 2001 17:31:25 +0200 Message-ID: <92274.1009726285@axl.seasidesoftware.co.za> Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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