Merge pull request #1089 from JacobBarthelmeh/StaticAnalysisTests

fix potential memory leaks
This commit is contained in:
toddouska 2017-08-07 11:47:33 -07:00 committed by GitHub
commit e9c6fa5f22
2 changed files with 4 additions and 1 deletions

View File

@ -18791,6 +18791,7 @@ WOLFSSL_DSA* wolfSSL_DSA_new(void)
if (wc_InitDsaKey(key) != 0) {
WOLFSSL_MSG("wolfSSL_DSA_new InitDsaKey failure");
XFREE(key, NULL, DYNAMIC_TYPE_DSA);
wolfSSL_DSA_free(external);
return NULL;
}
external->internal = key;

View File

@ -5470,8 +5470,10 @@ static int TLSX_KeyShareEntry_Parse(WOLFSSL* ssl, byte* input, word16 length,
/* Populate a key share object in the extension. */
ret = TLSX_KeyShare_Use(ssl, group, keLen, ke, kse);
if (ret != 0)
if (ret != 0) {
XFREE(ke, ssl->heap, DYNAMIC_TYPE_PUBLIC_KEY);
return ret;
}
/* Total length of the parsed data. */
return offset + keLen;