From: Jouni Malinen Date: Tue, 3 May 2022 21:05:09 +0000 (+0300) Subject: Fix tls_connection_set_success_data() in TLS library wrappers X-Git-Tag: hostap_2_11~1960 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccb3206b61fe6eab55296e6945cf0b52d19efbb8;p=thirdparty%2Fhostap.git Fix tls_connection_set_success_data() in TLS library wrappers Some of the TLS library wrappers defined only an empty function for tls_connection_set_success_data(). That could result in memory leaks in TLS server cases, so update these to do the minimal thing and free the provided buffer as unused. Signed-off-by: Jouni Malinen --- diff --git a/src/crypto/tls_gnutls.c b/src/crypto/tls_gnutls.c index daa01d9ed..e3f5b5a42 100644 --- a/src/crypto/tls_gnutls.c +++ b/src/crypto/tls_gnutls.c @@ -1766,6 +1766,7 @@ int tls_get_library_version(char *buf, size_t buf_len) void tls_connection_set_success_data(struct tls_connection *conn, struct wpabuf *data) { + wpabuf_free(data); } diff --git a/src/crypto/tls_internal.c b/src/crypto/tls_internal.c index ef33b59f8..f3e05ce34 100644 --- a/src/crypto/tls_internal.c +++ b/src/crypto/tls_internal.c @@ -783,6 +783,7 @@ int tls_get_library_version(char *buf, size_t buf_len) void tls_connection_set_success_data(struct tls_connection *conn, struct wpabuf *data) { + wpabuf_free(data); } diff --git a/src/crypto/tls_none.c b/src/crypto/tls_none.c index 6d6fb0caf..87f45f886 100644 --- a/src/crypto/tls_none.c +++ b/src/crypto/tls_none.c @@ -212,6 +212,7 @@ int tls_get_library_version(char *buf, size_t buf_len) void tls_connection_set_success_data(struct tls_connection *conn, struct wpabuf *data) { + wpabuf_free(data); }