[Libreoffice-commits] core.git: tools/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed May 8 11:21:06 UTC 2019


 tools/source/debug/debug.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit d3581eb79e204419a6906004c199512c1fa48a2c
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed May 8 08:46:06 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed May 8 13:20:06 2019 +0200

    AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete)
    
    __cxa_demangle uses malloc/free for memory management, see
    <http://itanium-cxx-abi.github.io/cxx-abi/abi.html#demangler>
    
    Change-Id: I57f8465d1c70fbef4537068fd3aefc52295e1c63
    Reviewed-on: https://gerrit.libreoffice.org/71942
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index 290e1a88a384..fdfd7259d3cf 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -50,6 +50,7 @@
 #include <sal/log.hxx>
 #include <osl/thread.h>
 
+#include <cstdlib>
 #include <typeinfo>
 
 #include <tools/diagnose_ex.h>
@@ -116,7 +117,7 @@ OString exceptionToString(const css::uno::Any & caught)
         sMessage += " context: ";
         sMessage += pContext;
 #if defined __GLIBCXX__
-        delete pContext;
+        std::free(const_cast<char *>(pContext));
 #endif
     }
     {


More information about the Libreoffice-commits mailing list