summaryrefslogtreecommitdiff
path: root/content/llcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'content/llcache.c')
-rw-r--r--content/llcache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/content/llcache.c b/content/llcache.c
index 0d20fe8ac..977c03804 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -1610,7 +1610,8 @@ void llcache_fetch_callback(fetch_msg msg, void *p, const void *data,
/* Shrink source buffer to required size */
temp = realloc(object->source_data,
object->source_len);
- if (temp != NULL) {
+ /* If source_len is 0, then temp may be NULL */
+ if (temp != NULL || object->source_len == 0) {
object->source_data = temp;
object->source_alloc = object->source_len;
}