shell/source/sessioninstall/SyncDbusSessionHelper.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 054dac27e0b33789bbb3ca444ae22ab4b157f998
Author: Caolán McNamara <caol...@redhat.com>
Date:   Fri Dec 22 11:01:14 2017 +0000

    call g_variant_unref on return value
    
    Change-Id: If8f0e443738060f51c8822783558ea14fb34b8ce
    Reviewed-on: https://gerrit.libreoffice.org/46962
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx 
b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
index ce3cb8aefca0..4092d146f7c2 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
@@ -18,7 +18,7 @@ using namespace ::com::sun::star::uno;
 
 namespace
 {
-    struct GVariantDeleter { void operator()(GVariant* pV) { 
g_variant_unref(pV); } };
+    struct GVariantDeleter { void operator()(GVariant* pV) { if (pV) 
g_variant_unref(pV); } };
     struct GVariantBuilderDeleter { void operator()(GVariantBuilder* pVB) { 
g_variant_builder_unref(pVB); } };
     template <typename T> struct GObjectDeleter { void operator()(T* pO) { 
g_object_unref(pO); } };
     class GErrorWrapper
@@ -72,12 +72,12 @@ void request(
     std::shared_ptr<GDBusProxy> proxy(
         lcl_GetPackageKitProxy("Modify"), GObjectDeleter<GDBusProxy>());
     GErrorWrapper error;
-    g_dbus_proxy_call_sync(
+    std::shared_ptr<GVariant> result(g_dbus_proxy_call_sync(
         proxy.get(), method,
         g_variant_new(
             "(uass)", static_cast<guint32>(xid), builder.get(),
             iactUtf8.getStr()),
-        G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error.getRef());
+        G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error.getRef()), 
GVariantDeleter());
 }
 
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to