1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-29 08:31:35 -08:00

Fix memory leak in fontset handling

* src/font.c (copy_font_spec): Make a deep copy of the input
argument FONT.  (Bug#21651)
This commit is contained in:
Dima Kogan 2015-10-20 18:12:55 +03:00 committed by Eli Zaretskii
parent 90e9cf85be
commit 28c58bf739

View file

@ -3981,7 +3981,10 @@ copy_font_spec (Lisp_Object font)
pcdr = spec->props + FONT_EXTRA_INDEX;
for (tail = AREF (font, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail))
if (!EQ (XCAR (XCAR (tail)), QCfont_entity))
*pcdr = Fcons (XCAR (tail), Qnil), pcdr = xcdr_addr (*pcdr);
{
*pcdr = Fcons (Fcons (XCAR (XCAR (tail)), CDR (XCAR (tail))), Qnil);
pcdr = xcdr_addr (*pcdr);
}
XSETFONT (new_spec, spec);
return new_spec;