summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2011-03-02 18:34:06 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2011-03-02 18:34:06 +0000
commit4f6c2d1a2500ce0d4ca0611831861e63bde672cc (patch)
tree9d26ae07a42a2bdf2839eee316d24150b853e016 /lib/libc/stdlib
parentfd2d334430301f05c6fc9ba4d9cb5dc026b3db93 (diff)
Fix __cxa_finalize() so that calling __cxa_finalize(NULL) properly
invokes handlers registered with __cxa_atexit(). "seems right" deraadt@
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/atexit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/atexit.c b/lib/libc/stdlib/atexit.c
index 4d28fb5ef69..e28ccf29d0d 100644
--- a/lib/libc/stdlib/atexit.c
+++ b/lib/libc/stdlib/atexit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atexit.c,v 1.14 2007/09/05 20:47:47 chl Exp $ */
+/* $OpenBSD: atexit.c,v 1.15 2011/03/02 18:34:05 matthew Exp $ */
/*
* Copyright (c) 2002 Daniel Hartmeier
* All rights reserved.
@@ -147,7 +147,7 @@ __cxa_finalize(void *dso)
p->fns[n].fn_ptr.cxa_func = NULL;
mprotect(p, pgsize, PROT_READ);
}
- if (dso != NULL)
+ if (fn.fn_dso != NULL)
(*fn.fn_ptr.cxa_func)(fn.fn_arg);
else
(*fn.fn_ptr.std_func)();