seperate sanity checks on size and rnd allocation

This commit is contained in:
kaleb-himes
2019-11-07 13:12:17 -07:00
parent ad192786b1
commit 5ce88b5086

View File

@ -2220,9 +2220,11 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
}
size = wolfSSL_get_server_random(ssl, rnd, size);
if (size == 0 && rnd != NULL) {
XFREE(rnd, NULL, DYNAMIC_TYPE_TMP_BUFFER);
rnd = NULL;
if (size == 0) {
if (rnd) {
XFREE(rnd, NULL, DYNAMIC_TYPE_TMP_BUFFER);
rnd = NULL;
}
err_sys_ex(runWithErrors, "error getting server random buffer");
}