From: Richard M. Stallman Date: Tue, 25 Nov 1997 04:49:10 +0000 (+0000) Subject: (free_fontset_data): Don't free null pointer. X-Git-Tag: emacs-20.3~2727 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=189987107d8c978e2f5527b8e76c48edc0ca83a5;p=emacs.git (free_fontset_data): Don't free null pointer. --- 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); }