-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix memory leak in ssl_server2 when buffer allocator and backtracing enabled #2070
Conversation
If `MBEDTLS_MEMORY_BUFFER_ALLOC_C` is configured and Mbed TLS' custom buffer allocator is used for calloc() and free(), the read buffer used by the server example application is allocated from the buffer allocator, but freed after the buffer allocator has been destroyed. If memory backtracing is enabled, this leaves a memory leak in the backtracing structure allocated for the buffer, as found by valgrind. Fixes Mbed-TLS#2069.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, as this is the correct sequence of operations. However, memory is not being leaked, as mbedtls_memory_buffer_alloc_free()
clears the whole heap, and the next call to mbedtls_free()
actually doesn't do anything. Nonetheless, this should be fixed
@RonEld No, as mentioned in the commit message the problem is that internally the buffer allocator uses the
|
ok |
retest |
Fixes #2069.