From ef4a3227facd57886c7a7bd7ae1e969047992f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 17 Apr 2008 11:55:04 +0000 Subject: [PATCH] * If there is no handler, we must not try to remove it from the linked list. * This fixes bug #1644 again. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24998 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/pthread/pthread_cleanup.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/system/libroot/posix/pthread/pthread_cleanup.cpp b/src/system/libroot/posix/pthread/pthread_cleanup.cpp index eae1f4d9d7..36b86c0c8d 100644 --- a/src/system/libroot/posix/pthread/pthread_cleanup.cpp +++ b/src/system/libroot/posix/pthread/pthread_cleanup.cpp @@ -27,8 +27,10 @@ __pthread_cleanup_pop_handler(void) return NULL; __pthread_cleanup_handler* handler = thread->cleanup_handlers; - thread->cleanup_handlers = handler->previous; + if (handler == NULL) + return NULL; + thread->cleanup_handlers = handler->previous; return handler; }