emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113925: (imagemagick_get_animation_cache): Fix a do


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] trunk r113925: (imagemagick_get_animation_cache): Fix a double-free error.
Date: Fri, 16 Aug 2013 15:10:16 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113925
revision-id: address@hidden
parent: address@hidden
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Fri 2013-08-16 17:10:13 +0200
message:
  (imagemagick_get_animation_cache): Fix a double-free error.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/image.c                    image.c-20091113204419-o5vbwnq5f7feedwu-2969
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-08-16 14:54:46 +0000
+++ b/src/ChangeLog     2013-08-16 15:10:13 +0000
@@ -1,6 +1,7 @@
 2013-08-16  Lars Magne Ingebrigtsen  <address@hidden>
 
        * image.c: Implement an ImageMagick per-image cache.
+       (imagemagick_get_animation_cache): Fix a double-free error.
 
 2013-08-16  Xue Fuqiao  <address@hidden>
 

=== modified file 'src/image.c'
--- a/src/image.c       2013-08-16 14:54:46 +0000
+++ b/src/image.c       2013-08-16 15:10:13 +0000
@@ -7901,9 +7901,9 @@
 imagemagick_prune_animation_cache ()
 {
   struct animation_cache *cache = animation_cache;
-  struct animation_cache *prev;
+  struct animation_cache *prev = NULL;
   EMACS_TIME old = sub_emacs_time (current_emacs_time (),
-                                  EMACS_TIME_FROM_DOUBLE (60));
+                                  EMACS_TIME_FROM_DOUBLE (5));
 
   while (cache)
     {
@@ -7920,17 +7920,18 @@
          cache = cache->next;
          free (this_cache);
        }
-      else {
-       prev = cache;
-       cache = cache->next;
-      }
+      else
+       {
+         prev = cache;
+         cache = cache->next;
+       }
     }
 }
 
 struct animation_cache *
 imagemagick_get_animation_cache (MagickWand *wand)
 {
-  char *signature = MagickGetImageSignature (wand);
+  char *signature = xstrdup (MagickGetImageSignature (wand));
   struct animation_cache *cache = animation_cache;
 
   imagemagick_prune_animation_cache ();


reply via email to

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