Blob Blame History Raw
From 3ebf54f0b940967c5c8de7f6d9df8c0b09a4bf21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Sat, 19 Dec 2015 15:08:01 +0000
Subject: [PATCH 378/398] coverity#1343631 Resource leak

Change-Id: Ic5d7c88ae4080c2e103fb691c2e326a9e239aa12
(cherry picked from commit 169298fa73d2c5429d1960db6049a4ed15653b4f)
Reviewed-on: https://gerrit.libreoffice.org/21268
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit 195866b16f044bc792526145b739602166ca7276)
---
 libreofficekit/source/gtk/lokdocview.cxx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 858f08b66890..a5fc4e34439e 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2647,13 +2647,13 @@ lok_doc_view_set_edit(LOKDocView* pDocView,
                       gboolean bEdit)
 {
     LOKDocViewPrivate& priv = getPrivate(pDocView);
+    if (!priv->m_pDocument)
+        return;
+
     GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr);
     LOEvent* pLOEvent = new LOEvent(LOK_SET_EDIT);
     GError* error = nullptr;
 
-    if (!priv->m_pDocument)
-        return;
-
     pLOEvent->m_bEdit = bEdit;
     g_task_set_task_data(task, pLOEvent, LOEvent::destroy);
 
-- 
2.12.0