Fixed crash during removal of last application in registryd.
authorTomasz Olszak <t.olszak@samsung.com>
Tue, 13 Oct 2015 15:37:38 +0000 (17:37 +0200)
committerMike Gorse <mgorse@suse.com>
Sun, 25 Oct 2015 00:09:48 +0000 (19:09 -0500)
Function find_index_of_reference always returned invalid index.

https://bugzilla.gnome.org/show_bug.cgi?id=756513

registryd/registry.c

index c533eb0..b5d91f8 100644 (file)
@@ -144,11 +144,12 @@ find_index_of_reference (GPtrArray *arr, const gchar *name, const gchar * path,
 
   ref = spi_reference_new (name, path);
 
-  for (i = 0; i < arr->len && found == FALSE; i++)
+  for (i = 0; i < arr->len; i++)
     {
-      if (compare_reference (ref, g_ptr_array_index (arr, i)));
+      if (compare_reference (ref, g_ptr_array_index (arr, i)))
         {
           found = TRUE;
+          break;
         }
     }