[tracker/tracker-0.12] libtracker-common: Error isn't set and yet reply is NULL



commit 0cf9852ad36f536b07df8cb38a46c5757d3aaa46
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu Jan 5 12:26:23 2012 +0100

    libtracker-common: Error isn't set and yet reply is NULL
    
    The g_dbus_connection_call_sync claims not to return NULL
    unless error is set. Yet we check for error being set and
    have seen situations where reply was NULL nonetheless.
    
    Test for reply being NULL and don't unref in that case.
    
    Fixes NB#289635.

 src/libtracker-common/tracker-locale-gconfdbus.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-common/tracker-locale-gconfdbus.c b/src/libtracker-common/tracker-locale-gconfdbus.c
index 3e93bbe..977e768 100644
--- a/src/libtracker-common/tracker-locale-gconfdbus.c
+++ b/src/libtracker-common/tracker-locale-gconfdbus.c
@@ -116,7 +116,9 @@ add_notify (void)
 		return FALSE;
 	}
 
-	g_variant_unref (reply);
+	if (reply) {
+		g_variant_unref (reply);
+	}
 
 	return TRUE;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]