diff options
Diffstat (limited to 'xlators/protocol/legacy/server/src/server-helpers.c')
-rw-r--r-- | xlators/protocol/legacy/server/src/server-helpers.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/xlators/protocol/legacy/server/src/server-helpers.c b/xlators/protocol/legacy/server/src/server-helpers.c index 7ab2ce885..595916a36 100644 --- a/xlators/protocol/legacy/server/src/server-helpers.c +++ b/xlators/protocol/legacy/server/src/server-helpers.c @@ -427,15 +427,17 @@ server_connection_destroy (xlator_t *this, server_connection_t *conn) INIT_LIST_HEAD (&file_lockers); INIT_LIST_HEAD (&dir_lockers); - LOCK (<able->lock); - { - list_splice_init (<able->file_lockers, - &file_lockers); + if (ltable) { + LOCK (<able->lock); + { + list_splice_init (<able->file_lockers, + &file_lockers); - list_splice_init (<able->dir_lockers, &dir_lockers); + list_splice_init (<able->dir_lockers, &dir_lockers); + } + UNLOCK (<able->lock); + GF_FREE (ltable); } - UNLOCK (<able->lock); - GF_FREE (ltable); flock.l_type = F_UNLCK; flock.l_start = 0; |