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



commit d8a25a0c0f2060d8343cce96d28153931139d589
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 ea22049..2ade289 100644
--- a/src/libtracker-common/tracker-locale-gconfdbus.c
+++ b/src/libtracker-common/tracker-locale-gconfdbus.c
@@ -126,7 +126,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]