Subject: bug#21651: closed (Re: bug#21651: 25.0.50; [PATCH] Memory leak: auto_fontset_alist has keys that are modified externally by mistake)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 20 Oct 2015 15:15:03 +0000

Your bug report

#21651: 25.0.50; [PATCH] Memory leak: auto_fontset_alist has keys that are modified externally by mistake

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
21651: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21651
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#21651: 25.0.50; [PATCH] Memory leak: auto_fontset_alist has keys that are modified externally by mistake
From: Eli Zaretskii <[email-masked]>
To: Dima Kogan <[email-masked]>
Cc: [email-masked]
Date: Tue, 20 Oct 2015 18:14:08 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Dima Kogan <[email-masked]>
> Date: Thu, 08 Oct 2015 14:49:11 -0700
> 
> This issue was discussed on the mailing list with the thread starting
> here:
> 
> https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg00550.html
> 
> A patch was proposed here:
> 
> https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg00292.html
> 
> and is copied here as an attachment.

Thanks, pushed.

Subject: 25.0.50; [PATCH] Memory leak: auto_fontset_alist has keys that are modified externally by mistake
From: Dima Kogan <[email-masked]>
To: [email-masked]
Date: Thu, 08 Oct 2015 14:49:11 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

This issue was discussed on the mailing list with the thread starting
here:

https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg00550.html

A patch was proposed here:

https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg00292.html

and is copied here as an attachment.

From: Dima Kogan <[email-masked]>
Date: Mon, 5 Oct 2015 11:21:12 -0700
Subject: (copy_font_spec) now makes a deeper copy of its input

---
 src/font.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/font.c b/src/font.c
index a52a653..0b2999e 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3981,7 +3981,12 @@ 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)),
+                              XCDR (XCAR (tail))),
+                       Qnil);
+        pcdr = xcdr_addr (*pcdr);
+      }
 
   XSETFONT (new_spec, spec);
   return new_spec;