mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-09-13 14:22:19 +08:00
ssl_tls: return correct error code if mbedtls_calloc fails
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
parent
951b3cb400
commit
365ee3eaa9
@ -306,7 +306,7 @@ static int resize_buffer(unsigned char **buffer, size_t len_new, size_t *len_old
|
|||||||
{
|
{
|
||||||
unsigned char *resized_buffer = mbedtls_calloc(1, len_new);
|
unsigned char *resized_buffer = mbedtls_calloc(1, len_new);
|
||||||
if (resized_buffer == NULL) {
|
if (resized_buffer == NULL) {
|
||||||
return -1;
|
return MBEDTLS_ERR_SSL_ALLOC_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We want to copy len_new bytes when downsizing the buffer, and
|
/* We want to copy len_new bytes when downsizing the buffer, and
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user