From 4bc20f6d3163933e49eb95cff698266e908133e1 Mon Sep 17 00:00:00 2001 From: Sunil Kumar Acharya Date: Mon, 6 Aug 2018 22:00:00 +0530 Subject: libglusterfs: FORWARD_NULL coverity fix Fixing FORWARD_NULL coverify errors in libglusterfs. CID: 1391407, 1391410 BUG: 789278 Change-Id: I3d20523005e4418759c8a72620edff7c977d2d00 updates: bz#789278 Signed-off-by: Sunil Kumar Acharya --- libglusterfs/src/dict.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libglusterfs/src/dict.c') 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); -- cgit