llcache: Free existing chain if we get a new one

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-05-24 17:01:05 +01:00
parent 114dd37c6e
commit b4c99f9e57
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74

View File

@ -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) {