diff options
author | David Chisnall <theraven@theravensnest.org> | 2012-02-28 20:10:15 +0000 |
---|---|---|
committer | David Chisnall <theraven@theravensnest.org> | 2012-02-28 20:10:15 +0000 |
commit | 3b2a9a00dd4267fcffd370390037001f912347a3 (patch) | |
tree | 61aa11757f9f650b2a8ae4f89a1065104745d69a /src | |
parent | b9c89de0416513998e06bf23115191717416a416 (diff) | |
download | libcxxrt-3b2a9a00dd4267fcffd370390037001f912347a3.tar.gz libcxxrt-3b2a9a00dd4267fcffd370390037001f912347a3.tar.bz2 libcxxrt-3b2a9a00dd4267fcffd370390037001f912347a3.tar.xz |
Fix bugs caused by writing code while half asleep.
Diffstat (limited to 'src')
-rw-r--r-- | src/cxa_atexit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cxa_atexit.c b/src/cxa_atexit.c index 48d6d1d..3f40247 100644 --- a/src/cxa_atexit.c +++ b/src/cxa_atexit.c @@ -13,7 +13,7 @@ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; int __cxa_atexit( void (*f)(void *), void *p, void *d) { pthread_mutex_lock(&lock); - struct atexit_handler *h = malloc(sizeof(*d)); + struct atexit_handler *h = malloc(sizeof(*h)); if (!h) { pthread_mutex_unlock(&lock); return 1; @@ -36,7 +36,7 @@ void __cxa_finalize(void *d ) { h->f(h->p); free(h); } else { - last = &head->next; + last = &h->next; } } pthread_mutex_unlock(&lock); |