diff options
author | Lars Magne Ingebrigtsen <[email protected]> | 2013-08-16 17:10:13 +0200 |
---|---|---|
committer | Lars Magne Ingebrigtsen <[email protected]> | 2013-08-16 17:10:13 +0200 |
commit | 8a6f875f7e613b2910ed3355ce0f2c01fa43cb9b (patch) | |
tree | c229128b36510cf3abb966e28587d8899fbe21fa /src/image.c | |
parent | 274ff63f7f7d19c3eb0c365ed7f8347131b9f62e (diff) |
(imagemagick_get_animation_cache): Fix a double-free error.
Diffstat (limited to 'src/image.c')
-rw-r--r-- | src/image.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/image.c b/src/image.c index 082cc6a762..ed10a3ed6c 100644 --- a/src/image.c +++ b/src/image.c @@ -7901,9 +7901,9 @@ void 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 @@ imagemagick_prune_animation_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 (); |