From: Radoslaw Zarzynski Date: Fri, 11 Mar 2016 16:33:47 +0000 (+0100) Subject: rgw: add handling of memory allocation failure in AWS4 auth. X-Git-Tag: v11.0.0~434^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ddbb0ab9d5046672795ec876221de9ebd466364f;p=ceph.git rgw: add handling of memory allocation failure in AWS4 auth. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index af6ae7d98b6e..825ac607959b 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -3160,7 +3160,11 @@ int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s) string algorithm = "AWS4-HMAC-SHA256"; - s->aws4_auth = new rgw_aws4_auth; + try { + s->aws4_auth = new rgw_aws4_auth; + } catch (std::bad_alloc&) { + return -ENOMEM; + } if ((!s->http_auth) || !(*s->http_auth)) {