From 189987107d8c978e2f5527b8e76c48edc0ca83a5 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 25 Nov 1997 04:49:10 +0000 Subject: [PATCH] (free_fontset_data): Don't free null pointer. --- src/fontset.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/fontset.c b/src/fontset.c index fa9ef93b029..976e27165c3 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -97,19 +97,22 @@ void free_fontset_data (fontset_data) struct fontset_data *fontset_data; { - int i; - - for (i = 0; i < fontset_data->n_fontsets; i++) + if (fontset_data->fontset_table) { - int j; + int i; - xfree (fontset_data->fontset_table[i]->name); - for (j = 0; j <= MAX_CHARSET; j++) - if (fontset_data->fontset_table[i]->fontname[j]) - xfree (fontset_data->fontset_table[i]->fontname[j]); - xfree (fontset_data->fontset_table[i]); + for (i = 0; i < fontset_data->n_fontsets; i++) + { + int j; + + xfree (fontset_data->fontset_table[i]->name); + for (j = 0; j <= MAX_CHARSET; j++) + if (fontset_data->fontset_table[i]->fontname[j]) + xfree (fontset_data->fontset_table[i]->fontname[j]); + xfree (fontset_data->fontset_table[i]); + } + xfree (fontset_data->fontset_table); } - xfree (fontset_data->fontset_table); xfree (fontset_data); } -- 2.39.2