emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110124: Fix list duplication error i


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110124: Fix list duplication error in define_image_type.
Date: Fri, 21 Sep 2012 11:52:23 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110124
fixes bug: http://debbugs.gnu.org/12463
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Fri 2012-09-21 11:52:23 +0800
message:
  Fix list duplication error in define_image_type.
  
  * image.c (define_image_type): Avoid adding duplicate types to
  image_types.  Suggested by Jörg Walter.
modified:
  src/ChangeLog
  src/image.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-09-21 03:03:48 +0000
+++ b/src/ChangeLog     2012-09-21 03:52:23 +0000
@@ -1,3 +1,8 @@
+2012-09-21  Chong Yidong  <address@hidden>
+
+       * image.c (define_image_type): Avoid adding duplicate types to
+       image_types (Bug#12463).  Suggested by Jörg Walter.
+
 2012-09-21  YAMAMOTO Mitsuharu  <address@hidden>
 
        * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.

=== modified file 'src/image.c'
--- a/src/image.c       2012-09-15 08:45:27 +0000
+++ b/src/image.c       2012-09-21 03:52:23 +0000
@@ -590,9 +590,15 @@
     success = Qnil;
   else
     {
+      struct image_type *p;
+      Lisp_Object target_type = *(type->type);
+      for (p = image_types; p; p = p->next)
+       if (EQ (*(p->type), target_type))
+         return Qt;
+
       /* Make a copy of TYPE to avoid a bus error in a dumped Emacs.
          The initialized data segment is read-only.  */
-      struct image_type *p = xmalloc (sizeof *p);
+      p = xmalloc (sizeof *p);
       *p = *type;
       p->next = image_types;
       image_types = p;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]