vcl/source/app/svapp.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit fd6bdd1a3ec7925b7208a0341248e09b02800795
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Sun May 16 21:12:42 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon May 17 10:02:40 2021 +0200

    fix leak when LOK not active
    
    Change-Id: I7124adfdc4e877fc63805956b3d0c087b1ffb5f5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115681
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 1f4f6e9e9de6..963a2a2f9457 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -322,13 +322,13 @@ void Application::notifyWindow(vcl::LOKWindowId 
/*nLOKWindowId*/,
 
 void Application::libreOfficeKitViewCallback(int nType, const char* pPayload) 
const
 {
-    if (!comphelper::LibreOfficeKit::isActive())
-        return;
-
-    if (m_pCallback)
+    if (!comphelper::LibreOfficeKit::isActive() || !m_pCallback)
     {
-        m_pCallback(nType, pPayload, m_pCallbackData);
+        free(static_cast<void*>(const_cast<char*>(pPayload)));
+        return;
     }
+
+    m_pCallback(nType, pPayload, m_pCallbackData);
 }
 
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to