diff options
author | Pranith K <pranithk@gluster.com> | 2010-12-16 01:24:33 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-12-27 20:50:55 -0800 |
commit | 953f89d82f2c444719ba3150c9890c072a2e7fb3 (patch) | |
tree | b5756f8638ae9b93cf77a141d08184ecb94928a5 /xlators/protocol/server | |
parent | e7512cbb171856a925b7db938da423b493339b00 (diff) |
glusterd,cli: print single error message on failure
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1922 (Volume not present wrong message displayed on command line)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1922
Diffstat (limited to 'xlators/protocol/server')
-rw-r--r-- | xlators/protocol/server/src/server.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 6c763e7fbbf..7c92441ea89 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; } |