Closed smuehlst closed 4 years ago
I may look like, that memory is leaked here, because the pointer to pSocket
is saved in a static array in CAdaptedSocket
and retrieved from there by a handle, which is probably not obvious. It is deleted here:
So I suppose, there is no memory leak here.
I see, a very sophisticated example how to outsmart static code analysis :+1:
Leaking memory. CAdaptedSocket [:28] is allocated on the heap and never freed. In function mbedtls_net_connect [:21] .
https://github.com/smuehlst/circle-stdlib/blob/0d349f6a4ffd08f3beae65d8385f461b3cb67029/src/circle-mbedtls/net_sockets.cpp#L28
Leaking memory. CAdaptedSocket [:53] is allocated on the heap and never freed. In function mbedtls_net_bind [:41] .
https://github.com/smuehlst/circle-stdlib/blob/0d349f6a4ffd08f3beae65d8385f461b3cb67029/src/circle-mbedtls/net_sockets.cpp#L53