Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Memory leak after DTLS request #23

Open
@vwout

Description

I'm using libnyoci in a library for Lua (to make coap available in Lua). When a lot of requests are made with DTLS activated, memory is getting lost.

It looks like somehow the tls data is not cleaned up. The data is received using the same loop that is in the cmd_get code of nyocictl:

 while (ERRORCODE_INPROGRESS == gRet) {
   if (nyoci) {
     nyoci_plat_wait(nyoci, 1000);
     nyoci_plat_process(nyoci);
   }
 }

After all response data from the GET request is received, I do call SSL_CTX_free on the SSL context and eventually nyoci_release. This however does not seem to cause the internal TLS functions SSL_shutdown or SSL_free to be called.

I reproduced this with nyocictl. A valgrind trace with a GET request shows that the memory allocated using SSL_new and BIO_new in openssl/nyoci-plat-tls.c are never free'd.

How can I make sure that all resources related to a specific DTLS ssl session are released after use?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions