fix memory leak with SMIME

This commit is contained in:
Jacob Barthelmeh
2021-07-23 10:38:11 +07:00
parent ab226e1a73
commit f2852dad4a

View File

@@ -18991,6 +18991,8 @@ int wc_MIME_parse_headers(char* in, int inLen, MimeHdr** headers)
mimeType == MIME_PARAM)) && pos >= 1) {
mimeStatus = MIME_BODYVAL;
end = pos-1;
if (nameAttr != NULL)
XFREE(nameAttr, NULL, DYNAMIC_TYPE_PKCS7);
ret = wc_MIME_header_strip(curLine, &nameAttr, start, end);
if (ret) {
goto error;
@@ -18999,6 +19001,8 @@ int wc_MIME_parse_headers(char* in, int inLen, MimeHdr** headers)
}
else if (mimeStatus == MIME_BODYVAL && cur == ';' && pos >= 1) {
end = pos-1;
if (bodyVal != NULL)
XFREE(bodyVal, NULL, DYNAMIC_TYPE_PKCS7);
ret = wc_MIME_header_strip(curLine, &bodyVal, start, end);
if (ret) {
goto error;