* src/haikufont.c (haikufont_close): Clear INFO->metrics,
glyphs, be_font after they are released and do not attempt to
access them if NULL. (bug#77478)
(cherry picked from commit
b9b52f009289ede7967a176bc6ed069c87514794)
return;
block_input ();
- if (info && info->be_font)
+ if (info->be_font)
BFont_close (info->be_font);
- for (i = 0; i < info->metrics_nrows; i++)
+ if (info->metrics)
{
- if (info->metrics[i])
- xfree (info->metrics[i]);
+ for (i = 0; i < info->metrics_nrows; i++)
+ {
+ if (info->metrics[i])
+ xfree (info->metrics[i]);
+ }
+ xfree (info->metrics);
}
- if (info->metrics)
- xfree (info->metrics);
-
- for (i = 0; i < 0x100; ++i)
+ if (info->glyphs)
{
- if (info->glyphs[i])
- xfree (info->glyphs[i]);
+ for (i = 0; i < 0x100; ++i)
+ {
+ if (info->glyphs[i])
+ xfree (info->glyphs[i]);
+ }
+ xfree (info->glyphs);
}
- xfree (info->glyphs);
+ info->metrics = NULL;
+ info->glyphs = NULL;
+ info->be_font = NULL;
unblock_input ();
}