]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_delete_display): Don't free or derefence NULL pointers.
authorKim F. Storm <storm@cua.dk>
Tue, 4 Jul 2006 14:14:36 +0000 (14:14 +0000)
committerKim F. Storm <storm@cua.dk>
Tue, 4 Jul 2006 14:14:36 +0000 (14:14 +0000)
src/xterm.c

index dfa5f4f4413f89fe1446d7fc3f8ec6556da255ef..0b16a37a62c3634c32f5a6279e70a6a1d0bcd383 100644 (file)
@@ -10772,12 +10772,16 @@ x_delete_display (dpyinfo)
        xfree (dpyinfo->font_table[i].name);
       }
 
-  if (dpyinfo->font_table->font_encoder)
-    xfree (dpyinfo->font_table->font_encoder);
-
-  xfree (dpyinfo->font_table);
-  xfree (dpyinfo->x_id_name);
-  xfree (dpyinfo->color_cells);
+  if (dpyinfo->font_table)
+    {
+      if (dpyinfo->font_table->font_encoder)
+       xfree (dpyinfo->font_table->font_encoder);
+      xfree (dpyinfo->font_table);
+    }
+  if (dpyinfo->x_id_name)
+    xfree (dpyinfo->x_id_name);
+  if (dpyinfo->color_cells)
+    xfree (dpyinfo->color_cells);
   xfree (dpyinfo);
 }