Commit 8a6f875f authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

(imagemagick_get_animation_cache): Fix a double-free error.

parent 274ff63f
2013-08-16 Lars Magne Ingebrigtsen <larsi@gnus.org> 2013-08-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
* image.c: Implement an ImageMagick per-image cache. * image.c: Implement an ImageMagick per-image cache.
(imagemagick_get_animation_cache): Fix a double-free error.
2013-08-16 Xue Fuqiao <xfq.free@gmail.com> 2013-08-16 Xue Fuqiao <xfq.free@gmail.com>
......
...@@ -7901,9 +7901,9 @@ void ...@@ -7901,9 +7901,9 @@ void
imagemagick_prune_animation_cache () imagemagick_prune_animation_cache ()
{ {
struct animation_cache *cache = 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 old = sub_emacs_time (current_emacs_time (),
EMACS_TIME_FROM_DOUBLE (60)); EMACS_TIME_FROM_DOUBLE (5));
while (cache) while (cache)
{ {
...@@ -7920,7 +7920,8 @@ imagemagick_prune_animation_cache () ...@@ -7920,7 +7920,8 @@ imagemagick_prune_animation_cache ()
cache = cache->next; cache = cache->next;
free (this_cache); free (this_cache);
} }
else { else
{
prev = cache; prev = cache;
cache = cache->next; cache = cache->next;
} }
...@@ -7930,7 +7931,7 @@ imagemagick_prune_animation_cache () ...@@ -7930,7 +7931,7 @@ imagemagick_prune_animation_cache ()
struct animation_cache * struct animation_cache *
imagemagick_get_animation_cache (MagickWand *wand) imagemagick_get_animation_cache (MagickWand *wand)
{ {
char *signature = MagickGetImageSignature (wand); char *signature = xstrdup (MagickGetImageSignature (wand));
struct animation_cache *cache = animation_cache; struct animation_cache *cache = animation_cache;
imagemagick_prune_animation_cache (); imagemagick_prune_animation_cache ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment