mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
fix for free'ing memory with test case
This commit is contained in:
@ -33211,7 +33211,7 @@ static int test_wolfSSL_RAND_bytes(void)
|
|||||||
|
|
||||||
max_bufsize = size4;
|
max_bufsize = size4;
|
||||||
|
|
||||||
ExpectNotNull(my_buf = (byte*)XMALLOC(max_bufsize * sizeof(byte), NULL,
|
ExpectNotNull(my_buf = (byte*)XMALLOC(max_bufsize * sizeof(byte), HEAP_HINT,
|
||||||
DYNAMIC_TYPE_TMP_BUFFER));
|
DYNAMIC_TYPE_TMP_BUFFER));
|
||||||
|
|
||||||
ExpectIntEQ(RAND_bytes(my_buf, 0), 1);
|
ExpectIntEQ(RAND_bytes(my_buf, 0), 1);
|
||||||
@ -33222,6 +33222,7 @@ static int test_wolfSSL_RAND_bytes(void)
|
|||||||
ExpectIntEQ(RAND_bytes(my_buf, size2), 1);
|
ExpectIntEQ(RAND_bytes(my_buf, size2), 1);
|
||||||
ExpectIntEQ(RAND_bytes(my_buf, size3), 1);
|
ExpectIntEQ(RAND_bytes(my_buf, size3), 1);
|
||||||
ExpectIntEQ(RAND_bytes(my_buf, size4), 1);
|
ExpectIntEQ(RAND_bytes(my_buf, size4), 1);
|
||||||
|
XFREE(my_buf, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
|
|
||||||
#if defined(OPENSSL_EXTRA) && defined(HAVE_GETPID)
|
#if defined(OPENSSL_EXTRA) && defined(HAVE_GETPID)
|
||||||
XMEMSET(seed, 0, sizeof(seed));
|
XMEMSET(seed, 0, sizeof(seed));
|
||||||
@ -33262,8 +33263,6 @@ static int test_wolfSSL_RAND_bytes(void)
|
|||||||
}
|
}
|
||||||
RAND_cleanup();
|
RAND_cleanup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XFREE(my_buf, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
#endif
|
||||||
return EXPECT_RESULT();
|
return EXPECT_RESULT();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user