summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authormarc <marc@openbsd.org>2004-04-06 03:56:39 +0000
committermarc <marc@openbsd.org>2004-04-06 03:56:39 +0000
commit13178f5e791389c118052cc65d8df8b590507ee0 (patch)
tree295090fa0ecefd17a6a134d660705167c6377bb8 /lib/libpthread
parentremove optimization workaround for sparc64 now that we're using gcc3. (diff)
downloadwireguard-openbsd-13178f5e791389c118052cc65d8df8b590507ee0.tar.xz
wireguard-openbsd-13178f5e791389c118052cc65d8df8b590507ee0.zip
Apply patch from guenther at mho.com (pr3730) that fixes a double
free in the threads library
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/uthread/uthread_gc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_gc.c b/lib/libpthread/uthread/uthread_gc.c
index d59708d753d..85fe0590051 100644
--- a/lib/libpthread/uthread/uthread_gc.c
+++ b/lib/libpthread/uthread/uthread_gc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_gc.c,v 1.13 2003/12/23 20:10:45 brad Exp $ */
+/* $OpenBSD: uthread_gc.c,v 1.14 2004/04/06 03:56:39 marc Exp $ */
/*
* Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -132,8 +132,10 @@ _thread_gc(pthread_addr_t arg)
* Point to the stack structure that must
* be freed outside the locks:
*/
- if (pthread->stack != NULL)
+ if (pthread->stack != NULL) {
p_stack = pthread->stack;
+ pthread->stack = NULL;
+ }
/*
* Point to the thread structure that must