mirror of https://github.com/wolfSSL/wolfssl.git
ocsp: fix memory leaks in OpenSSL compat layer
parent
79744a7736
commit
dedbb2526c
11
src/ocsp.c
11
src/ocsp.c
|
@ -917,12 +917,17 @@ out:
|
||||||
|
|
||||||
void wolfSSL_OCSP_RESPONSE_free(OcspResponse* response)
|
void wolfSSL_OCSP_RESPONSE_free(OcspResponse* response)
|
||||||
{
|
{
|
||||||
|
OcspEntry *s, *sNext;
|
||||||
if (response == NULL)
|
if (response == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (response->single != NULL) {
|
|
||||||
FreeOcspEntry(response->single, NULL);
|
s = response->single;
|
||||||
XFREE(response->single, NULL, DYNAMIC_TYPE_OCSP_ENTRY);
|
while (s != NULL) {
|
||||||
|
sNext = s->next;
|
||||||
|
FreeOcspEntry(s, NULL);
|
||||||
|
XFREE(s, NULL, DYNAMIC_TYPE_OCSP_ENTRY);
|
||||||
|
s = sNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
XFREE(response->source, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(response->source, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
|
|
|
@ -36967,6 +36967,7 @@ static int DecodeResponseData(byte* source, word32* ioIndex,
|
||||||
XMEMSET(single->next->status, 0, sizeof(CertStatus));
|
XMEMSET(single->next->status, 0, sizeof(CertStatus));
|
||||||
|
|
||||||
single->next->isDynamic = 1;
|
single->next->isDynamic = 1;
|
||||||
|
single->next->ownStatus = 1;
|
||||||
|
|
||||||
single = single->next;
|
single = single->next;
|
||||||
}
|
}
|
||||||
|
@ -37056,6 +37057,7 @@ static int DecodeResponseData(byte* source, word32* ioIndex,
|
||||||
|
|
||||||
/* Entry to be freed. */
|
/* Entry to be freed. */
|
||||||
single->next->isDynamic = 1;
|
single->next->isDynamic = 1;
|
||||||
|
single->next->ownStatus = 1;
|
||||||
/* used will be 0 (false) */
|
/* used will be 0 (false) */
|
||||||
|
|
||||||
single = single->next;
|
single = single->next;
|
||||||
|
|
Loading…
Reference in New Issue