Make GList more robust
authorMatthias Clasen <mclasen@redhat.com>
Sat, 2 Mar 2013 00:11:11 +0000 (19:11 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 2 Mar 2013 00:11:11 +0000 (19:11 -0500)
g_list_delete_link was silently ignoring a NULL link before
the last change. Make it do so again, since we've found callers
that rely on this.

glib/glist.c

index 620b58d..073bcaa 100644 (file)
@@ -425,6 +425,9 @@ static inline GList*
 _g_list_remove_link (GList *list,
                     GList *link)
 {
+  if (link == NULL)
+    return list;
+
   if (link->prev)
     {
       if (link->prev->next == link)