]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix potential memory leaks in RGWPutCORS_ObjStore_S3::get_params
authorYan Jun <yan.jun8@zte.com.cn>
Tue, 28 Jun 2016 08:17:58 +0000 (16:17 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Tue, 28 Jun 2016 08:17:58 +0000 (16:17 +0800)
We should free `data` before return or jump to `done_err` label.

Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/rgw/rgw_rest_s3.cc

index 1d64aa061a70688a9d68ecb534c5206df2d6d098..caea9446153ed3a635a02acf786dbf9c01ad1aae 100644 (file)
@@ -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;
     }
   }