Commit 33bc8a79 authored by marko's avatar marko

Port r114 from branches/5.0:

lock_rec_unlock(): Initialize local variable release_lock, in order to avoid
dereferencing an uninitialized pointer when no lock exists on rec.

This bug was introduced in r103 of branches/5.0, ported as r104 to trunk.
parent 7515828b
...@@ -3762,7 +3762,7 @@ lock_rec_unlock( ...@@ -3762,7 +3762,7 @@ lock_rec_unlock(
ulint lock_mode) /* in: LOCK_S or LOCK_X */ ulint lock_mode) /* in: LOCK_S or LOCK_X */
{ {
lock_t* lock; lock_t* lock;
lock_t* release_lock; lock_t* release_lock = NULL;
ulint heap_no; ulint heap_no;
ut_ad(trx && rec); ut_ad(trx && rec);
...@@ -3787,7 +3787,7 @@ lock_rec_unlock( ...@@ -3787,7 +3787,7 @@ lock_rec_unlock(
/* If a record lock is found, release the record lock */ /* If a record lock is found, release the record lock */
if(UNIV_LIKELY(release_lock != NULL)) { if (UNIV_LIKELY(release_lock != NULL)) {
lock_rec_reset_nth_bit(release_lock, heap_no); lock_rec_reset_nth_bit(release_lock, heap_no);
} else { } else {
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment