mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Prevent double frees in closing fonts provided by the Haiku font driver
* 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)
This commit is contained in:
parent
f77f464637
commit
b9b52f0092
1 changed files with 20 additions and 13 deletions
|
|
@ -890,25 +890,32 @@ haikufont_close (struct font *font)
|
|||
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[i])
|
||||
xfree (info->metrics[i]);
|
||||
}
|
||||
|
||||
if (info->metrics)
|
||||
xfree (info->metrics);
|
||||
|
||||
for (i = 0; i < 0x100; ++i)
|
||||
{
|
||||
if (info->glyphs[i])
|
||||
xfree (info->glyphs[i]);
|
||||
for (i = 0; i < info->metrics_nrows; i++)
|
||||
{
|
||||
if (info->metrics[i])
|
||||
xfree (info->metrics[i]);
|
||||
}
|
||||
xfree (info->metrics);
|
||||
}
|
||||
|
||||
xfree (info->glyphs);
|
||||
if (info->glyphs)
|
||||
{
|
||||
for (i = 0; i < 0x100; ++i)
|
||||
{
|
||||
if (info->glyphs[i])
|
||||
xfree (info->glyphs[i]);
|
||||
}
|
||||
xfree (info->glyphs);
|
||||
}
|
||||
|
||||
info->metrics = NULL;
|
||||
info->glyphs = NULL;
|
||||
info->be_font = NULL;
|
||||
unblock_input ();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue