ssl_tls: return correct error code if mbedtls_calloc fails

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index b163e93..348894b 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -306,7 +306,7 @@
 {
     unsigned char *resized_buffer = mbedtls_calloc(1, len_new);
     if (resized_buffer == NULL) {
-        return -1;
+        return MBEDTLS_ERR_SSL_ALLOC_FAILED;
     }
 
     /* We want to copy len_new bytes when downsizing the buffer, and