Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jul 2005 14:51:48 +0200 (CEST)
From:      Dan Lukes <dan@obluda.cz>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/83452: [ PATCH ] Unhandled malloc failure within libpthread
Message-ID:  <200507141251.j6ECpmGP032817@kulesh.obluda.cz>
Resent-Message-ID: <200507141300.j6ED0IVd002445@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         83452
>Category:       bin
>Synopsis:       [ PATCH ] Unhandled malloc failure within libpthread
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 14 13:00:18 GMT 2005
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507141251.j6ECpmGP032817>