From 69c6cf551754e51debb4e645716a89e29517f4ee Mon Sep 17 00:00:00 2001 From: Yan Jun Date: Tue, 28 Jun 2016 16:17:58 +0800 Subject: [PATCH] rgw: fix potential memory leaks in RGWPutCORS_ObjStore_S3::get_params We should free `data` before return or jump to `done_err` label. Signed-off-by: Yan Jun --- src/rgw/rgw_rest_s3.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 1d64aa061a706..caea9446153ed 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -2311,7 +2311,8 @@ int RGWPutCORS_ObjStore_S3::get_params() if (s->aws4_auth_needs_complete) { int ret_auth = do_aws4_auth_completion(); if (ret_auth < 0) { - return ret_auth; + r = ret_auth; + goto done_err; } } -- 2.39.5