diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-19 09:57:58 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-06-19 15:38:52 +0200 |
commit | 8df7447139b1171d8fd29f5d682b053df5936006 (patch) | |
tree | 29b966e34ac6ff5adf408b9c017670e17c389127 /tools/qa | |
parent | 9b7a890fd59744459692d7f66402c6bdd25acec4 (diff) |
asan: need to use malloc instead of new for tools::JsonWriter
because the LOK API expects memory returned from those calls to be
malloc'ed
Change-Id: If6fbfb60c433bd6e58bc90a9a90a90663e2e1c60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96676
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'tools/qa')
-rw-r--r-- | tools/qa/cppunit/test_json_writer.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/qa/cppunit/test_json_writer.cxx b/tools/qa/cppunit/test_json_writer.cxx index c4e9331c8d17..e27afc95f712 100644 --- a/tools/qa/cppunit/test_json_writer.cxx +++ b/tools/qa/cppunit/test_json_writer.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <sal/config.h> + +#include <cstdlib> + #include <cppunit/extensions/HelperMacros.h> #include <test/bootstrapfixture.hxx> #include <rtl/ustring.hxx> @@ -44,7 +48,11 @@ void JsonWriterTest::test1() aJson.put("int", 12); } - std::unique_ptr<char[]> result(aJson.extractData()); + struct Free + { + void operator()(void* p) const { std::free(p); } + }; + std::unique_ptr<char, Free> result(aJson.extractData()); CPPUNIT_ASSERT_EQUAL(std::string("{ \"node\": { \"oustring\": \"val1\", \"ostring\": \"val2\", " "\"charptr\": \"val3\", \"int\": 12}}"), |