diff options
author | Humble Devassy Chirammal <hchiramm@redhat.com> | 2015-04-07 11:27:19 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-04-25 07:26:43 -0700 |
commit | f6e24fc54453669f3943e50f44cce9bb6070a71a (patch) | |
tree | 718a2526bd519587889876a3feb362535669de07 | |
parent | 557ea3781e984f5f3cf206dd4b8d0a81c8cbdb58 (diff) |
cli: Error out when there is not enough memory
Change-Id: Ia8d061de5be1343cc10a945f6cf011686a770d33
BUG: 1211594
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>
-rw-r--r-- | cli/src/cli-rpc-ops.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); |