diff --git a/src/internal.c b/src/internal.c index d4a493a83..c69309e72 100644 --- a/src/internal.c +++ b/src/internal.c @@ -15478,6 +15478,8 @@ static int DoCertificateStatus(WOLFSSL* ssl, byte* input, word32* inOutIdx, else if (idx == 1) /* server cert must be OK */ ret = BAD_CERTIFICATE_STATUS_ERROR; } + + /* only frees 'single' if single->isDynamic is set */ FreeOcspResponse(response); *inOutIdx += status_length; diff --git a/src/ssl.c b/src/ssl.c index 6db1347fc..fb2d80176 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -36777,18 +36777,18 @@ int wolfSSL_PEM_write_bio_PKCS7(WOLFSSL_BIO* bio, PKCS7* p7) break; default: WOLFSSL_MSG("Unknown PKCS#7 Type"); - return WOLFSSL_FAILURE; + goto error; }; if ((wc_PKCS7_EncodeSignedData_ex(p7, hashBuf, hashSz, outputHead, &outputHeadSz, outputFoot, &outputFootSz)) != 0) - return WOLFSSL_FAILURE; + goto error; outputSz = outputHeadSz + p7->contentSz + outputFootSz; output = (byte*)XMALLOC(outputSz, bio->heap, DYNAMIC_TYPE_TMP_BUFFER); if (!output) - return WOLFSSL_FAILURE; + goto error; XMEMSET(output, 0, outputSz); outputSz = 0;