summaryrefslogtreecommitdiff
path: root/mysys/lf_hash.c
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2011-12-02 15:35:05 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2011-12-02 15:35:05 +0100
commitc4f5908a799e0b6ddcdc44f9957b5f99aaf40fd6 (patch)
tree8945418a6db73395e8a8136b49084d553dda51e9 /mysys/lf_hash.c
parent970bc8cd0bd01073899a3f371cbe1ad3d0cf2057 (diff)
downloadmariadb-git-c4f5908a799e0b6ddcdc44f9957b5f99aaf40fd6.tar.gz
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.
Diffstat (limited to 'mysys/lf_hash.c')
-rw-r--r--mysys/lf_hash.c22
1 files changed, 11 insertions, 11 deletions
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);