summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/dict.c')
-rw-r--r--libglusterfs/src/dict.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index aa893845659..aedb7c9660c 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -2240,7 +2240,9 @@ _dict_modify_flag (dict_t *this, char *key, int flag, int op)
return 0;
err:
- UNLOCK (&this->lock);
+ if (key && this)
+ UNLOCK (&this->lock);
+
if (pair) {
if (pair->key)
free(pair->key);