summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorHumble Devassy Chirammal <hchiramm@redhat.com>2015-04-07 11:27:19 +0530
committerKaushal M <kaushal@redhat.com>2015-05-09 00:31:57 -0700
commit1c2ebcddb0e7e72ca40bae07419afbe958dfa60a (patch)
tree180c69b2fc7abcc04fe56fc2e08a135a9a461761 /cli
parent9fee35681c5803e6badb2509f8d7c151aa174fda (diff)
cli: Error out when there is not enough memory
Change-Id: Ia8d061de5be1343cc10a945f6cf011686a770d33 BUG: 1220020 Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/10144 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com> (cherry picked from commit f6e24fc54453669f3943e50f44cce9bb6070a71a) Reviewed-on: http://review.gluster.org/10674 Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 080c225e64d..5361e83a1f6 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -6994,7 +6994,11 @@ gf_cli_status_cbk (struct rpc_req *req, struct iovec *iov,
}
status.brick = GF_CALLOC (1, PATH_MAX + 256, gf_common_mt_strdup);
-
+ if (!status.brick) {
+ errno = ENOMEM;
+ ret = -1;
+ goto out;
+ }
switch (cmd & GF_CLI_STATUS_MASK) {
case GF_CLI_STATUS_MEM:
cli_print_volume_status_mem (dict, notbrick);