From: Yan Jun Date: Tue, 28 Jun 2016 08:17:58 +0000 (+0800) Subject: rgw: fix potential memory leaks in RGWPutCORS_ObjStore_S3::get_params X-Git-Tag: v10.2.4~107^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fb36dd0c7a72ce5f3affd69d1f77e6222e26de94;p=ceph.git 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 (cherry picked from commit 69c6cf551754e51debb4e645716a89e29517f4ee) --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 27ae9e696ab5..3d70a9e215a1 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -2138,7 +2138,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; } }