Mercurial > emacs
diff src/xterm.c @ 71610:9ffb5cb61a66
(x_delete_display): Don't free or derefence NULL pointers.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Tue, 04 Jul 2006 14:14:36 +0000 |
parents | 030275d8610f |
children | da0099bc0ba4 b19aaf4ab0ee 138ce2701550 |
line wrap: on
line diff
--- a/src/xterm.c Tue Jul 04 14:14:13 2006 +0000 +++ b/src/xterm.c Tue Jul 04 14:14:36 2006 +0000 @@ -10772,12 +10772,16 @@ 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); }