From: Dima Kogan Date: Tue, 20 Oct 2015 15:12:55 +0000 (+0300) Subject: Fix memory leak in fontset handling X-Git-Tag: emacs-25.0.90~1080 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=28c58bf739fb5cc528051cfc48770fbfa4e1a319;p=emacs.git Fix memory leak in fontset handling * src/font.c (copy_font_spec): Make a deep copy of the input argument FONT. (Bug#21651) --- diff --git a/src/font.c b/src/font.c index a52a653d29b..be55ce9bc7b 100644 --- a/src/font.c +++ b/src/font.c @@ -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;