summaryrefslogtreecommitdiff
path: root/mysys/lf_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/lf_hash.c')
-rw-r--r--mysys/lf_hash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c
index 83cfe1a1639..38b212c65f0 100644
--- a/mysys/lf_hash.c
+++ b/mysys/lf_hash.c
@@ -268,8 +268,10 @@ static LF_SLIST *lsearch(LF_SLIST * volatile *head, CHARSET_INFO *cs,
int res= lfind(head, cs, hashnr, key, keylen, &cursor, pins);
if (res)
_lf_pin(pins, 2, cursor.curr);
- _lf_unpin(pins, 0);
+ else
+ _lf_unpin(pins, 2);
_lf_unpin(pins, 1);
+ _lf_unpin(pins, 0);
return res ? cursor.curr : 0;
}