diff options
author | Manikandan Selvaganesh <mselvaga@redhat.com> | 2015-02-10 14:59:09 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-04-07 03:52:05 -0700 |
commit | aa0befea352402922839dd846c798c0da2afd271 (patch) | |
tree | 4d813cd07658bafa012f667d02578f329ee93eb5 /xlators/cluster/dht/src/dht-shared.c | |
parent | a0e3634c6f0d349a3433cdbeabd93043f5f43e9d (diff) |
dht : coverity fixes
CID : 1124352,1124365 (unchecked return value),
1124377 ( logically dead code),
1124511 (null dereference)
Change-Id: I61e029a078559cfe15d36bf0aa53418f6214e5cb
BUG: 789278
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-on: http://review.gluster.org/9622
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-shared.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-shared.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c index 0c008d83653..fc281b80287 100644 --- a/xlators/cluster/dht/src/dht-shared.c +++ b/xlators/cluster/dht/src/dht-shared.c @@ -594,8 +594,12 @@ dht_init (xlator_t *this) conf->search_unhashed = GF_DHT_LOOKUP_UNHASHED_ON; if (dict_get_str (this->options, "lookup-unhashed", &temp_str) == 0) { /* If option is not "auto", other options _should_ be boolean */ - if (strcasecmp (temp_str, "auto")) - gf_string2boolean (temp_str, &conf->search_unhashed); + if (strcasecmp (temp_str, "auto")) { + ret = gf_string2boolean (temp_str, + &conf->search_unhashed); + if (ret == -1) + goto err; + } else conf->search_unhashed = GF_DHT_LOOKUP_UNHASHED_AUTO; } |