]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix potential memory leaks in RGWPutCORS_ObjStore_S3::get_params 10656/head
authorYan Jun <yan.jun8@zte.com.cn>
Tue, 28 Jun 2016 08:17:58 +0000 (16:17 +0800)
committerLoic Dachary <ldachary@redhat.com>
Wed, 10 Aug 2016 11:37:36 +0000 (13:37 +0200)
We should free `data` before return or jump to `done_err` label.

Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
(cherry picked from commit 69c6cf551754e51debb4e645716a89e29517f4ee)

src/rgw/rgw_rest_s3.cc

index 27ae9e696ab5793254221966dafe12ea14f795ba..3d70a9e215a1c83be446e889f009715094d1df5d 100644 (file)
@@ -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;
     }
   }