Skip to content

Commit

Permalink
rgw: add handling of memory allocation failure in AWS4 auth.
Browse files Browse the repository at this point in the history
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
  • Loading branch information
rzarzynski committed Mar 11, 2016
1 parent 164de7a commit ddbb0ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rgw/rgw_rest_s3.cc
Expand Up @@ -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)) {

Expand Down

0 comments on commit ddbb0ab

Please sign in to comment.