summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2011-01-11 01:24:02 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-01-11 23:58:27 -0800
commite344d58762e12aa1edd1d4b133e1c1f77229b370 (patch)
tree8668bda83d64a06f8d2b009fd996fd74c65b948b
parentf5934192a32a76baa12b7a22035187e63b7fdc1d (diff)
exit if the key or the value is null while retrieving the peer information in glusterd_restore
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2271 ([glusterfs-3.1.2qa3]: entry->hostname in glusterd_friend_find_by_hostname is 0x0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2271
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index aa63226a5aa..fa67c23e979 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -844,6 +844,9 @@ glusterd_store_iter_get_next (glusterd_store_iter_t *iter,
*value = gf_strdup (iter_val);
*key = gf_strdup (iter_key);
+ if (!iter_key || !iter_val)
+ goto out;
+
ret = 0;
out:
@@ -1438,6 +1441,11 @@ glusterd_store_retrieve_peers (xlator_t *this)
goto out;
ret = glusterd_store_iter_get_next (iter, &key, &value);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR, "key: %p, and value: %p",
+ key, value);
+ goto out;
+ }
while (!ret) {