[tracker] Revert "tracker-store: avoid NULL dereference in ptr"



commit 08691d71d8a8de19107d9fb70b8fa11e47b2d90a
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Jul 8 12:40:02 2010 +0200

    Revert "tracker-store: avoid NULL dereference in ptr"
    
    This reverts commit fe247b2577e7d4fd1b41a1ef43bbded2d0e6a576.
    
      (Broke path for ptr && error)

 src/tracker-store/tracker-resources.c |   35 ++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 18 deletions(-)
---
diff --git a/src/tracker-store/tracker-resources.c b/src/tracker-store/tracker-resources.c
index aecb51e..70e051b 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
@@ -214,29 +214,28 @@ query_callback (gpointer inthread_data, GError *error, gpointer user_data)
 	InThreadPtr *ptr = inthread_data;
 	TrackerDBusMethodInfo *info = user_data;
 
-	if (ptr) {
-		if (ptr->error) {
-			tracker_dbus_request_failed (info->request_id,
-			                             info->context,
-			                             &ptr->error,
-			                             NULL);
-			dbus_g_method_return_error (info->context, ptr->error);
-			g_error_free (ptr->error);
-		} else {
-			/* Success */
-			tracker_dbus_request_success (info->request_id,
-			                              info->context);
-
-			dbus_g_method_send_reply (info->context, ptr->reply);
-		}
-		g_slice_free (InThreadPtr, ptr);
+	if (ptr && ptr->error) {
+		tracker_dbus_request_failed (info->request_id,
+		                             info->context,
+		                             &ptr->error,
+		                             NULL);
+		dbus_g_method_return_error (info->context, ptr->error);
+		g_error_free (ptr->error);
 	} else if (error) {
 		tracker_dbus_request_failed (info->request_id,
 		                             info->context,
 		                             &error,
 		                             NULL);
 		dbus_g_method_return_error (info->context, error);
-	} /* else !ptr && !error */
+	} else {
+		tracker_dbus_request_success (info->request_id,
+		                              info->context);
+
+		dbus_g_method_send_reply (info->context, ptr->reply);
+	}
+
+	if (ptr)
+		g_slice_free (InThreadPtr, ptr);
 }
 
 static gpointer



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