From 5a8963b13795402c88451e7167b3335a94643643 Mon Sep 17 00:00:00 2001 From: Jorge Arellano Cid Date: Thu, 19 Jun 2014 13:53:58 -0400 Subject: Fixed a potential problem in a_Dicache_unref() Currently I see no way to hit the condition, but better safe than sorry. --- src/dicache.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/dicache.c b/src/dicache.c index 39d89509..82043590 100644 --- a/src/dicache.c +++ b/src/dicache.c @@ -224,6 +224,8 @@ void a_Dicache_unref(const DilloUrl *Url, int version) if (entry->RefCount > 0) --entry->RefCount; if (entry->v_imgbuf == NULL || (entry->RefCount == 0 && a_Imgbuf_last_reference(entry->v_imgbuf))) + if (entry->RefCount == 0 && + (!entry->v_imgbuf || a_Imgbuf_last_reference(entry->v_imgbuf))) Dicache_remove(Url, version); } } -- cgit v1.2.3