From c4f5908a799e0b6ddcdc44f9957b5f99aaf40fd6 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 2 Dec 2011 15:35:05 +0100 Subject: Fixed crashes found by application verifier: - leaking mutex in lf_hash_destroy - pthread_getspecific() before pthread_key_create() in my_thread_var_dbug() (called by static C++ object constructors called in sys_vars) - perfschema destroys mutexes that were not created. --- mysys/lf_hash.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'mysys/lf_hash.c') diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c index 28e97192f18..83cfe1a1639 100644 --- a/mysys/lf_hash.c +++ b/mysys/lf_hash.c @@ -335,18 +335,18 @@ void lf_hash_destroy(LF_HASH *hash) { LF_SLIST *el, **head= (LF_SLIST **)_lf_dynarray_value(&hash->array, 0); - if (unlikely(!head)) - return; - el= *head; - - while (el) + if (head) { - intptr next= el->link; - if (el->hashnr & 1) - lf_alloc_direct_free(&hash->alloc, el); /* normal node */ - else - my_free(el); /* dummy node */ - el= (LF_SLIST *)next; + el= *head; + while (el) + { + intptr next= el->link; + if (el->hashnr & 1) + lf_alloc_direct_free(&hash->alloc, el); /* normal node */ + else + my_free(el); /* dummy node */ + el= (LF_SLIST *)next; + } } lf_alloc_destroy(&hash->alloc); lf_dynarray_destroy(&hash->array); -- cgit v1.2.1