Avoid possible NULL pointer dereference
authorkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 29 Nov 2009 02:33:22 +0000 (02:33 +0000)
committerkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 29 Nov 2009 02:33:22 +0000 (02:33 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31108 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/tcp_graph.c

index f666027591be458dc9f500f715fc968f5a0cad27..925d0870a0b13871045376ac96b965a2ceca25e6 100644 (file)
@@ -2583,10 +2583,13 @@ static void magnify_destroy (struct graph *g)
        gdk_pixmap_unref (mg->pixmap[1]);
        for (list=mg->elists; list; list=list->next)
                g_free (list->elements);
-       while (mg->elists->next) {
-               list = mg->elists->next->next;
-               g_free (mg->elists->next);
-               mg->elists->next = list;
+
+       if (mg->elists) {
+    while (mg->elists->next) {
+      list = mg->elists->next->next;
+      g_free (mg->elists->next);
+      mg->elists->next = list;
+    }
        }
        g_free (g->magnify.g);
        g->magnify.active = 0;