From: Casey Bodley Date: Sun, 5 Mar 2023 02:11:43 +0000 (-0500) Subject: rgw/admin: fix formatter leaks again X-Git-Tag: v19.0.0~1564^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d1de5fd89c4967151647b0641de145912a00f4fc;p=ceph.git rgw/admin: fix formatter leaks again 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 --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 8745b5b3dd4b..2dc8e2c6c178 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -4312,9 +4312,9 @@ int main(int argc, const char **argv) } if (format == "xml") - formatter = make_unique(new XMLFormatter(pretty_format)); + formatter = make_unique(pretty_format); else if (format == "json") - formatter = make_unique(new JSONFormatter(pretty_format)); + formatter = make_unique(pretty_format); else { cerr << "unrecognized format: " << format << std::endl; exit(1);