diff options
author | David Chisnall <theraven@theravensnest.org> | 2014-05-09 01:35:22 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-05-09 01:35:22 +0000 |
commit | 4b7314e6262f3a73f1b0d33083fda697f70d1e75 (patch) | |
tree | 61aa11757f9f650b2a8ae4f89a1065104745d69a | |
parent | 0e92e7aa22c539390c52289e57566c4aaf890296 (diff) | |
parent | 3b2a9a00dd4267fcffd370390037001f912347a3 (diff) | |
download | libcxxrt-4b7314e6262f3a73f1b0d33083fda697f70d1e75.tar.gz |
am 3b2a9a00: Fix bugs caused by writing code while half asleep.
* commit '3b2a9a00dd4267fcffd370390037001f912347a3':
Fix bugs caused by writing code while half asleep.
-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); |