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 <sheggodu@redhat.com>
This commit is contained in:
Sunil Kumar Acharya 2018-08-06 22:00:00 +05:30 committed by Amar Tumballi
parent fc233b8f69
commit 4bc20f6d31
2 changed files with 7 additions and 1 deletions

View File

@ -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);

View File

@ -429,6 +429,10 @@ event_dispatch_poll_resize (struct event_pool *event_pool,
event_pool->evcache = ufds;
}
if (ufds == NULL) {
goto unlock;
}
for (i = 0; i < event_pool->used; i++) {
ufds[i].fd = event_pool->reg[i].fd;
ufds[i].events = event_pool->reg[i].events;