Kyber: fix OQS memory leak

This commit is contained in:
Sean Parkinson
2022-09-15 09:18:47 +10:00
parent 7f2659bb9b
commit ad39e8f77d
2 changed files with 7 additions and 1 deletions

View File

@ -356,6 +356,8 @@ int wc_KyberKey_MakeKey(KyberKey* key, WC_RNG* rng)
ForceZero(key, sizeof(*key));
}
OQS_KEM_free(kem);
return ret;
}
@ -432,6 +434,8 @@ int wc_KyberKey_Encapsulate(KyberKey* key, unsigned char* ct, unsigned char* ss,
}
#endif /* HAVE_PQM4 */
OQS_KEM_free(kem);
return ret;
}
@ -519,6 +523,8 @@ int wc_KyberKey_Decapsulate(KyberKey* key, unsigned char* ss,
}
#endif /* HAVE_PQM4 */
OQS_KEM_free(kem);
return ret;
}

View File

@ -1,4 +1,4 @@
/* ext_kyber.c
/* ext_kyber.h
*
* Copyright (C) 2006-2022 wolfSSL Inc.
*