Curl fetcher: Guard against read of uninitialised value.

Fixes Coverity issue:

CID 1419830:  Memory - illegal accesses  (UNINIT)
>>>     Using uninitialized value "buf[depth]".
This commit is contained in:
Michael Drake 2020-02-24 14:58:16 +00:00
parent 63dd59bd2e
commit 0140d1e5b1

View File

@ -676,6 +676,9 @@ fetch_curl_store_certs_in_cache(struct curl_fetch_info *f)
/* release the openssl memory buffer */
for (depth = 0; depth < chain.depth; depth++) {
if (chain.certs[depth].err == SSL_CERT_ERR_CERT_MISSING) {
continue;
}
if (buf[depth] != NULL) {
BUF_MEM_free(buf[depth]);
}