buglwIP - A Lightweight TCP/IP stack - Bugs: bug #59032, Possible memory leak

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #59032: Possible memory leak

Submitted by:  Ondrej Lufinka <ondrej_lufinka>
Submitted on:  Fri 28 Aug 2020 01:09:03 PM UTC  
 
Category:  Platform ports Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  Erik Ekman <yarrick>
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Wed 13 Jan 2021 09:22:09 PM UTC, comment #2: 

I have fixed this like you suggested David:

https://git.savannah.nongnu.org/cgit/lwip.git/commit/?id=b5618c51caf3ac34540c71312a43acd07bfe1857

I have not been able to test it, let me know if there are any problems.

Erik Ekman <yarrick>
Project MemberIn charge of this item.
Fri 18 Sep 2020 12:32:10 PM UTC, comment #1: 

Hi Ondrej,

It seems there is a missing call to mbedtls_ssl_config_free(&conf->conf); in altcp_tls_free_config() before altcp_mbedtls_free_config(conf);

Nice finding!

Regards,
David

David GIRAULT <dgirault>
Fri 28 Aug 2020 01:09:03 PM UTC, original submission:  

I use LwIP on STM32 MCU. I have a working combination of LwIP + MbedTLS + MQTT. I found a possible memory leak in function altcp_tls_create_config_client_2wayauth. Inside the function mbedtls_ssl_conf_own_cert there is line:

new_cert = mbedtls_calloc( 1, sizeof( mbedtls_ssl_key_cert ) );

which allocates new memory. This memory is never released. When I added line:

mbedtls_free(conf->conf.key_cert);

to the altcp_tls_free_config function, the memory leak is gone.

Ondrej Lufinka <ondrej_lufinka>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by yarrick (Posted a comment)
  • -email is unavailable- added by dgirault (Posted a comment)
  • -email is unavailable- added by ondrej_lufinka (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-13 yarrick StatusNone => Fixed
        Assigned toNone => yarrick
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.5