]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/admin: fix formatter leaks again 50383/head
authorCasey Bodley <cbodley@redhat.com>
Sun, 5 Mar 2023 02:11:43 +0000 (21:11 -0500)
committerCasey Bodley <cbodley@redhat.com>
Sun, 5 Mar 2023 14:28:34 +0000 (09:28 -0500)
the Formatter constructors take a 'bool pretty' argument. the pointers
allocated by 'new' were being converted to bools and leaked by
make_unique

this was already fixed in 5302c18c7eeda11021714eeb01438f20e580e166,
but reverted in a rebase by 200f71a90c9e77c91452cec128c2c8be0d3d6f1f

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_admin.cc

index 8745b5b3dd4b38e18af28164b5120d4e6a186bb7..2dc8e2c6c178b2cb03431482b443e197a38df124 100644 (file)
@@ -4312,9 +4312,9 @@ int main(int argc, const char **argv)
   }
 
   if (format ==  "xml")
-    formatter = make_unique<XMLFormatter>(new XMLFormatter(pretty_format));
+    formatter = make_unique<XMLFormatter>(pretty_format);
   else if (format == "json")
-    formatter = make_unique<JSONFormatter>(new JSONFormatter(pretty_format));
+    formatter = make_unique<JSONFormatter>(pretty_format);
   else {
     cerr << "unrecognized format: " << format << std::endl;
     exit(1);