Convey that it's ok for mbedtls_ssl_session_save to fail
mbedtls_ssl_session_save() always outputs the output length, even on error.
Here, we're only calling it to get the needed output length, so it's ok to
ignore the return value. Convey this to linters.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c
index ca74c00..c0c546e 100644
--- a/programs/ssl/ssl_client2.c
+++ b/programs/ssl/ssl_client2.c
@@ -2145,8 +2145,8 @@
}
/* get size of the buffer needed */
- mbedtls_ssl_session_save(mbedtls_ssl_get_session_pointer(&ssl),
- NULL, 0, &session_data_len);
+ (void) mbedtls_ssl_session_save(mbedtls_ssl_get_session_pointer(&ssl),
+ NULL, 0, &session_data_len);
session_data = mbedtls_calloc(1, session_data_len);
if (session_data == NULL) {
mbedtls_printf(" failed\n ! alloc %u bytes for session data\n",