[glib] Make GList more robust



commit 14768e97f8c87c0f4a32a7f946017fd853a67512
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 1 19:11:11 2013 -0500

    Make GList more robust
    
    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 |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/glib/glist.c b/glib/glist.c
index 620b58d..073bcaa 100644
--- a/glib/glist.c
+++ b/glib/glist.c
@@ -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)


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