Skip to content

Commit c11176c

Browse files
Fixes CID 330401 and 330392 memory leak
1 parent 8add411 commit c11176c

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/internal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15478,6 +15478,8 @@ static int DoCertificateStatus(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1547815478
else if (idx == 1) /* server cert must be OK */
1547915479
ret = BAD_CERTIFICATE_STATUS_ERROR;
1548015480
}
15481+
15482+
/* only frees 'single' if single->isDynamic is set */
1548115483
FreeOcspResponse(response);
1548215484

1548315485
*inOutIdx += status_length;

src/ssl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36777,18 +36777,18 @@ int wolfSSL_PEM_write_bio_PKCS7(WOLFSSL_BIO* bio, PKCS7* p7)
3677736777
break;
3677836778
default:
3677936779
WOLFSSL_MSG("Unknown PKCS#7 Type");
36780-
return WOLFSSL_FAILURE;
36780+
goto error;
3678136781
};
3678236782

3678336783
if ((wc_PKCS7_EncodeSignedData_ex(p7, hashBuf, hashSz,
3678436784
outputHead, &outputHeadSz, outputFoot, &outputFootSz)) != 0)
36785-
return WOLFSSL_FAILURE;
36785+
goto error;
3678636786

3678736787
outputSz = outputHeadSz + p7->contentSz + outputFootSz;
3678836788
output = (byte*)XMALLOC(outputSz, bio->heap, DYNAMIC_TYPE_TMP_BUFFER);
3678936789

3679036790
if (!output)
36791-
return WOLFSSL_FAILURE;
36791+
goto error;
3679236792

3679336793
XMEMSET(output, 0, outputSz);
3679436794
outputSz = 0;

0 commit comments

Comments
 (0)