[tracker] tracker-store: proper avoiding of NULL dereference in ptr



commit 1b6011edc1333e541c62405207740e2d2a0ec736
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Jul 8 12:43:41 2010 +0200

    tracker-store: proper avoiding of NULL dereference in ptr

 src/tracker-store/tracker-resources.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-store/tracker-resources.c b/src/tracker-store/tracker-resources.c
index 70e051b..7a25faf 100644
--- a/src/tracker-store/tracker-resources.c
+++ b/src/tracker-store/tracker-resources.c
@@ -57,7 +57,7 @@
  * bytes plus DBusMessage's overhead. If that makes this number less
  * arbitrary for you, then fine.
  *
- * I really hope that the libdbus people get to their senses and 
+ * I really hope that the libdbus people get to their senses and
  * either stop doing their exit() nonsense in a library, and instead
  * return a clean DBusError or something, or create crystal clear
  * clarity about the maximum size of a message. And make it both so
@@ -227,12 +227,12 @@ query_callback (gpointer inthread_data, GError *error, gpointer user_data)
 		                             &error,
 		                             NULL);
 		dbus_g_method_return_error (info->context, error);
-	} else {
+	} else if (ptr) {
 		tracker_dbus_request_success (info->request_id,
 		                              info->context);
 
 		dbus_g_method_send_reply (info->context, ptr->reply);
-	}
+	} /* else, !ptr && !error... shouldn't happen */
 
 	if (ptr)
 		g_slice_free (InThreadPtr, ptr);



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