From dan@kulesh.obluda.cz  Thu Jul 14 12:51:52 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 56E0D16A41C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 14 Jul 2005 12:51:52 +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 53C6243D45
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 14 Jul 2005 12:51:50 +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 j6ECpnwd032818
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 14 Jul 2005 14:51:49 +0200 (CEST)
	(envelope-from dan@kulesh.obluda.cz)
Received: (from root@localhost)
	by kulesh.obluda.cz (8.13.3/8.13.1/Submit) id j6ECpmGP032817;
	Thu, 14 Jul 2005 14:51:48 +0200 (CEST)
	(envelope-from dan)
Message-Id: <200507141251.j6ECpmGP032817@kulesh.obluda.cz>
Date: Thu, 14 Jul 2005 14:51:48 +0200 (CEST)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [ PATCH ] Unhandled malloc failure within libpthread
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         83452
>Category:       bin
>Synopsis:       [ PATCH ] Unhandled malloc failure within libpthread
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    deischen
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 14 13:00:18 GMT 2005
>Closed-Date:    Mon Aug 29 13:50:56 GMT 2005
>Last-Modified:  Mon Aug 29 13:50:56 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/libpthread/thread/thr_rtld.c,v 1.5 2003/11/05 18:19:24 deischen

>Description:
	Unhandled malloc failure within libpthread's _thr_rtld_lock_create()
>How-To-Repeat:
>Fix:

--- patch begins here ---
--- lib/libpthread/thread/thr_rtld.c.ORIG	Fri Nov 14 03:25:07 2003
+++ lib/libpthread/thread/thr_rtld.c	Thu Jul 14 14:38:22 2005
@@ -160,7 +160,8 @@
 {
 	struct rtld_kse_lock *l;
 
-	l = malloc(sizeof(struct rtld_kse_lock));
+	if ((l = malloc(sizeof(struct rtld_kse_lock))) == NULL)
+		return(l);
 	_lock_init(&l->lck, LCK_ADAPTIVE, _kse_lock_wait, _kse_lock_wakeup);
 	l->owner = NULL;
 	l->count = 0;
--- patch ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->deischen 
Responsible-Changed-By: glebius 
Responsible-Changed-When: Fri Aug 12 12:29:50 GMT 2005 
Responsible-Changed-Why:  
Assign to author. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=83452 
State-Changed-From-To: open->closed 
State-Changed-By: deischen 
State-Changed-When: Mon Aug 29 13:50:37 GMT 2005 
State-Changed-Why:  
Fixed 

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