2013-08-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
* 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>
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)
{
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 ();