mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
run allocation tool on ocsp and check for mallocs
This commit is contained in:
7
src/io.c
7
src/io.c
@@ -976,12 +976,13 @@ int EmbedOcspLookup(void* ctx, const char* url, int urlSz,
|
||||
}
|
||||
|
||||
|
||||
/* in default callback ctx is heap hint */
|
||||
void EmbedOcspRespFree(void* ctx, byte *resp)
|
||||
{
|
||||
(void)ctx;
|
||||
|
||||
if (resp)
|
||||
XFREE(resp, NULL, DYNAMIC_TYPE_OCSP);
|
||||
XFREE(resp, ctx, DYNAMIC_TYPE_OCSP);
|
||||
|
||||
(void)ctx;
|
||||
}
|
||||
|
||||
|
||||
|
10
src/ocsp.c
10
src/ocsp.c
@@ -71,7 +71,7 @@ static int InitOcspEntry(OcspEntry* entry, OcspRequest* request)
|
||||
}
|
||||
|
||||
|
||||
static void FreeOcspEntry(OcspEntry* entry)
|
||||
static void FreeOcspEntry(OcspEntry* entry, void* heap)
|
||||
{
|
||||
CertStatus *status, *next;
|
||||
|
||||
@@ -81,10 +81,12 @@ static void FreeOcspEntry(OcspEntry* entry)
|
||||
next = status->next;
|
||||
|
||||
if (status->rawOcspResponse)
|
||||
XFREE(status->rawOcspResponse, NULL, DYNAMIC_TYPE_OCSP_STATUS);
|
||||
XFREE(status->rawOcspResponse, heap, DYNAMIC_TYPE_OCSP_STATUS);
|
||||
|
||||
XFREE(status, NULL, DYNAMIC_TYPE_OCSP_STATUS);
|
||||
XFREE(status, heap, DYNAMIC_TYPE_OCSP_STATUS);
|
||||
}
|
||||
|
||||
(void)heap;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +98,7 @@ void FreeOCSP(WOLFSSL_OCSP* ocsp, int dynamic)
|
||||
|
||||
for (entry = ocsp->ocspList; entry; entry = next) {
|
||||
next = entry->next;
|
||||
FreeOcspEntry(entry);
|
||||
FreeOcspEntry(entry, ocsp->cm->heap);
|
||||
XFREE(entry, ocsp->cm->heap, DYNAMIC_TYPE_OCSP_ENTRY);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user