From 2ccf3ea4ab216f43e4846b0c11f65a28845162ca Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 11 Dec 2019 18:41:05 +0000 Subject: [PATCH] Test solidity_free in tests too --- test/libsolidity/LibSolc.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/libsolidity/LibSolc.cpp b/test/libsolidity/LibSolc.cpp index 7f6b30355..8b3820d4d 100644 --- a/test/libsolidity/LibSolc.cpp +++ b/test/libsolidity/LibSolc.cpp @@ -59,8 +59,9 @@ bool containsError(Json::Value const& _compilerResult, string const& _type, stri Json::Value compile(string const& _input, CStyleReadFileCallback _callback = nullptr) { - string output(solidity_compile(_input.c_str(), _callback, nullptr)); - // This should be safe given the above copies the output. + const char* output_ptr = solidity_compile(_input.c_str(), _callback, nullptr); + string output(output_ptr); + solidity_free(output_ptr); solidity_reset(); Json::Value ret; BOOST_REQUIRE(jsonParseStrict(output, ret));