diff options
Diffstat (limited to 'libglusterfs/src/dict.c')
| -rw-r--r-- | libglusterfs/src/dict.c | 13 | 
1 files changed, 6 insertions, 7 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c index 22bf3f99d70..c4f3fb71de3 100644 --- a/libglusterfs/src/dict.c +++ b/libglusterfs/src/dict.c @@ -1433,7 +1433,7 @@ fail:   */ -static int +int  dict_get_with_ref (dict_t *this, char *key, data_t **data)  {          data_pair_t * pair = NULL; @@ -1453,14 +1453,13 @@ dict_get_with_ref (dict_t *this, char *key, data_t **data)          LOCK (&this->lock);          {                  pair = dict_lookup_common (this, key, hash); -        } -        UNLOCK (&this->lock); -        if (pair) { -                ret = 0; -                *data = data_ref (pair->value); +                if (pair) { +                        ret = 0; +                        *data = data_ref (pair->value); +                 }          } - +        UNLOCK (&this->lock);  err:          return ret;  }  | 
