fix for memory leak

This commit is contained in:
Jacob Barthelmeh
2021-07-06 23:37:35 +07:00
parent a6ce91f3bb
commit b1a6d88af6

View File

@ -19094,13 +19094,11 @@ int wc_MIME_parse_headers(char* in, int inLen, MimeHdr** headers)
}
*headers = curHdr;
XFREE(nextHdr, NULL, DYNAMIC_TYPE_PKCS7);
XFREE(nextParam, NULL, DYNAMIC_TYPE_PKCS7);
return 0;
ret = 0; /* success if at this point */
error:
wc_MIME_free_hdrs(curHdr);
if (ret != 0)
wc_MIME_free_hdrs(curHdr);
wc_MIME_free_hdrs(nextHdr);
if (nameAttr != NULL)
XFREE(nameAttr, NULL, DYNAMIC_TYPE_PKCS7);