Skip to content

Commit 7fda7e7

Browse files
VladGudCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent afbb4f2 commit 7fda7e7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

gost_tls12_additional_kdftree.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ int gost_kdftree2012_256(unsigned char *keyout, size_t keyout_len,
4242
};
4343

4444
mac = EVP_MAC_fetch(NULL, OSSL_MAC_NAME_HMAC, NULL);
45-
if (mac == NULL || (ctx = EVP_MAC_CTX_new(mac)) == NULL) {
45+
if (mac == NULL) {
46+
GOSTerr(GOST_F_GOST_KDFTREE2012_256, ERR_R_INTERNAL_ERROR);
47+
return 0;
48+
}
49+
50+
ctx = EVP_MAC_CTX_new(mac);
51+
if (ctx == NULL) {
4652
GOSTerr(GOST_F_GOST_KDFTREE2012_256, ERR_R_MALLOC_FAILURE);
4753
EVP_MAC_free(mac);
4854
return 0;

0 commit comments

Comments
 (0)