locking: Set the lock_ctx->request to NULL when request is freed
authorStefan Metzmacher <metze@samba.org>
Mon, 1 Jun 2015 14:15:11 +0000 (00:15 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 15 Jun 2015 02:13:01 +0000 (12:13 +1000)
commit53e21c2aafa9c4912fd2bd90ef16570e4ec772a3
treeaf5d175ae38198a8879f756cec1b5505e0b26c04
parent9d2ba86dc9ec8bebc7d28c62d729c5dbe2aca1ec
locking: Set the lock_ctx->request to NULL when request is freed

The code was added to ctdb_lock_context_destructor() to ensure that
the if a lock_ctx gets freed first, the lock_request does not have a
dangling pointer.  However, the reverse is also true.  When a lock_request
is freed, then lock_ctx should not have a dangling pointer.

In commit 374cbc7b0ff68e04ee4e395935509c7df817b3c0, the code for second
condition was dropped causing a regression.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit 752ec31bcbbfe9f5b3b1c5dde4179d69f41cb53c)
server/ctdb_lock.c