diff options
author | Sunil Kumar Acharya <sheggodu@redhat.com> | 2018-08-06 22:00:00 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-08-16 06:16:57 +0000 |
commit | 4bc20f6d3163933e49eb95cff698266e908133e1 (patch) | |
tree | 3c28526f7481a6d3a1829cd0c4aa2df74ce186cf /libglusterfs | |
parent | fc233b8f6989fba02f77e0b0a5adbce1166bd7fe (diff) |
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>
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/dict.c | 4 | ||||
-rw-r--r-- | libglusterfs/src/event-poll.c | 4 |
2 files changed, 7 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); diff --git a/libglusterfs/src/event-poll.c b/libglusterfs/src/event-poll.c index 797649f11b8..283e2861b2b 100644 --- a/libglusterfs/src/event-poll.c +++ b/libglusterfs/src/event-poll.c @@ -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; |