Skip to content

Commit 66caf5a

Browse files
committed
free enc and dec before returning MEMORY_E
1 parent ba39aac commit 66caf5a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

wolfcrypt/test/test.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28242,8 +28242,11 @@ static wc_test_ret_t openssl_aes_test(void)
2824228242
int num = 0;
2824328243

2824428244
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
28245-
if ((enc == NULL) || (dec == NULL))
28245+
if ((enc == NULL) || (dec == NULL)) {
28246+
XFREE(enc, HEAP_HINT, DYNAMIC_TYPE_AES);
28247+
XFREE(dec, HEAP_HINT, DYNAMIC_TYPE_AES);
2824628248
return MEMORY_E;
28249+
}
2824728250
#endif
2824828251

2824928252
XMEMCPY(iv, setIv, sizeof(setIv));

0 commit comments

Comments
 (0)