bin/83452: [ PATCH ] Unhandled malloc failure within libpthread

Dan Lukes dan at obluda.cz
Thu Jul 14 13:00:19 GMT 2005


>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:


More information about the freebsd-bugs mailing list