From 4fbd0f6db18b65a664808fee7d5adab67e2c00ad Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 4 Jul 2006 14:14:36 +0000 Subject: [PATCH] (x_delete_display): Don't free or derefence NULL pointers. --- src/xterm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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); } -- 2.39.2