From f6e24fc54453669f3943e50f44cce9bb6070a71a Mon Sep 17 00:00:00 2001 From: Humble Devassy Chirammal Date: Tue, 7 Apr 2015 11:27:19 +0530 Subject: cli: Error out when there is not enough memory Change-Id: Ia8d061de5be1343cc10a945f6cf011686a770d33 BUG: 1211594 Signed-off-by: Humble Devassy Chirammal Reviewed-on: http://review.gluster.org/10144 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cli/src/cli-rpc-ops.c') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index e8a81cd6523..769fdb62330 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -7050,7 +7050,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); -- cgit