From: Kim F. Storm Date: Tue, 4 Jul 2006 14:14:36 +0000 (+0000) Subject: (x_delete_display): Don't free or derefence NULL pointers. X-Git-Tag: emacs-pretest-22.0.90~1713 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4fbd0f6db18b65a664808fee7d5adab67e2c00ad;p=emacs.git (x_delete_display): Don't free or derefence NULL pointers. --- diff --git a/src/xterm.c b/src/xterm.c index dfa5f4f4413..0b16a37a62c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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); }