From 953f89d82f2c444719ba3150c9890c072a2e7fb3 Mon Sep 17 00:00:00 2001 From: Pranith K Date: Thu, 16 Dec 2010 01:24:33 +0000 Subject: glusterd,cli: print single error message on failure Signed-off-by: Pranith Kumar K Signed-off-by: Anand V. Avati BUG: 1922 (Volume not present wrong message displayed on command line) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1922 --- xlators/protocol/server/src/server.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'xlators/protocol') diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 6c763e7fb..7c92441ea 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -503,8 +503,12 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) } } - if (!auth_modules) - auth_modules = dict_new (); + auth_modules = dict_new (); + if (!auth_modules) { + gf_log (this->name, GF_LOG_ERROR, "Out of memory"); + ret = -1; + goto out; + } dict_foreach (options, get_auth_types, auth_modules); ret = validate_auth_options (this, options); @@ -516,11 +520,9 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) } ret = gf_auth_init (this, auth_modules); - if (ret) { - dict_unref (auth_modules); - goto out; - } out: + if (auth_modules) + dict_unref (auth_modules); return ret; } -- cgit