From e344d58762e12aa1edd1d4b133e1c1f77229b370 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 11 Jan 2011 01:24:02 +0000 Subject: exit if the key or the value is null while retrieving the peer information in glusterd_restore Signed-off-by: Raghavendra Bhat Signed-off-by: Anand V. Avati 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 --- xlators/mgmt/glusterd/src/glusterd-store.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators/mgmt/glusterd/src') 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) { -- cgit