diff --git a/content/llcache.c b/content/llcache.c index 0d92a99cc..c1ddea54c 100644 --- a/content/llcache.c +++ b/content/llcache.c @@ -3078,6 +3078,11 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p) case FETCH_CERTS: /* Certificate information from the fetch */ + if (object->chain != NULL) { + cert_chain_free(object->chain); + object->chain = NULL; + } + /* Persist the chain onto our object */ error = cert_chain_dup(msg->data.chain, &object->chain); if (error != NSERROR_OK) {