From dan@kulesh.obluda.cz  Wed Jul 13 22:02:36 2005
Return-Path: <dan@kulesh.obluda.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A030716A41C
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 13 Jul 2005 22:02:36 +0000 (GMT)
	(envelope-from dan@kulesh.obluda.cz)
Received: from kulesh.obluda.cz (kulesh.obluda.cz [193.179.22.243])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C454943D48
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 13 Jul 2005 22:02:35 +0000 (GMT)
	(envelope-from dan@kulesh.obluda.cz)
Received: from kulesh.obluda.cz (localhost.eunet.cz [127.0.0.1])
	by kulesh.obluda.cz (8.13.3/8.13.3) with ESMTP id j6DM2XfT025409
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 14 Jul 2005 00:02:33 +0200 (CEST)
	(envelope-from dan@kulesh.obluda.cz)
Received: (from root@localhost)
	by kulesh.obluda.cz (8.13.3/8.13.1/Submit) id j6DM2WW2025408;
	Thu, 14 Jul 2005 00:02:32 +0200 (CEST)
	(envelope-from dan)
Message-Id: <200507132202.j6DM2WW2025408@kulesh.obluda.cz>
Date: Thu, 14 Jul 2005 00:02:32 +0200 (CEST)
From: Dan Lukes <dan@kulesh.obluda.cz>
Reply-To: Dan Lukes <dan@kulesh.obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [ PATCH ] incorrect malloc failures handling within libstand
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         83419
>Category:       bin
>Synopsis:       [ PATCH ] incorrect malloc failures handling within libstand
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 13 22:10:17 GMT 2005
>Closed-Date:    Thu Jul 14 12:37:35 GMT 2005
>Last-Modified:  Thu Jul 14 12:37:35 GMT 2005
>Originator:     Dan Lukes
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
Obludarium
>Environment:
System: FreeBSD 5.4-STABLE #8: Sat Jul 9 16:31:08 CEST 2005 i386
lib/libstand/environment.c,v 1.6 2003/10/26 04:04:12 peter

>Description:
	Incorrect malloc failures handling within libstand environment
handling
>How-To-Repeat:
>Fix:

--- patch begins here ---
--- lib/libstand/environment.c.ORIG	Fri Nov 14 03:26:04 2003
+++ lib/libstand/environment.c	Wed Jul 13 23:57:38 2005
@@ -82,7 +82,13 @@
 	 * New variable; create and sort into list
 	 */
 	ev = malloc(sizeof(struct env_var));
+	if (ev == NULL)
+		return(-1);
 	ev->ev_name = strdup(name);
+	if (ev->name == NULL) {
+		freee(ev);
+		return(-1);
+	}
 	ev->ev_value = NULL;
 	/* hooks can only be set when the variable is instantiated */
 	ev->ev_sethook = sethook;
--- patch ends here ---
>Release-Note:
>Audit-Trail:

From: Dan Lukes <dan@obluda.cz>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/83419: [ PATCH ] incorrect malloc failures handling within
 libstand
Date: Thu, 14 Jul 2005 02:26:20 +0200

 	The patch is:
 
 	1) incorrect
 	2) incomplete
 
 	Excuse me, but I'm sended the incorrect email.
 
 	Please close this PR.
 
 	The corrected PR has been submitted as bin/83424
 
 				Dan
 
 -- 
 Dan Lukes                                   SISAL MFF UK
State-Changed-From-To: open->closed 
State-Changed-By: keramida 
State-Changed-When: Thu Jul 14 12:37:16 GMT 2005 
State-Changed-Why:  
Superseded by PR bin/83424 

http://www.freebsd.org/cgi/query-pr.cgi?pr=83419 
>Unformatted:
