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

Submitter:  Ondrej Lufinka <ondrej_lufinka>
Submitted:  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:  yarrick
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Thu 15 Jun 2023 08:01:16 PM UTC, comment #3: 

Hi there,

I'm investigating the absence of the fix Erik has submitted to 2.1.x release brance, beside other commits.

This fix is apparently on master branch.

I'm wondering whether it is missed to be added to the release branch, or there's some strategy that I was unaware of..

Thanks

Hamza Hajeir <hamzahajeir>
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>
Group Member
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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 hamzahajeir (Posted a comment)
  • -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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    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.13-f8d8.
    Corresponding source code