Skip to content
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 recv() #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

schoeler
Copy link

@schoeler schoeler commented Sep 11, 2023

fix memory leak in recv() due to early return causing sl_91x_host_free_buffer() to never be called found during port from wiseconnect SDK 2.0 to wiseconnect SDK 3.0 causing malloc() failure after running for several minutes

fix memory leak in recv() due to early return causing sl_si91x_host_free_buffer() to never be called
@schoeler
Copy link
Author

schoeler commented Sep 11, 2023

It appears the VERIFY_STATUS_AND_RETURN() pattern is used throughout the SDK codebase and by design, this memory leak could also occur in

  • close()
  • select()
  • sl_wifi_connect()
  • sl_wifi_get_signal_strength()
  • sl_wifi_get_mac_address()
  • sl_wifi_get_channel()
  • sl_wifi_start_ap()
  • sl_wifi_get_pairwise_master_key()
  • sl_wifi_get_ap_client_info()
  • sl_wifi_get_firmware_version()
  • sl_wifi_get_statistics()
  • sl_wifi_generate_wps_pin()
  • sl_dns_host_get_by_name()
  • sl_wifi_wait_for_scan_results()
  • sl_si91x_configure_ip_address()
  • sl_si91x_ota_firmware_upgradation()
  • sl_si91x_recvfrom()
  • sl_si91x_select()
  • etc

I would recommend either removing the *_RETURN() pattern, or using the VERIFY_STATUS_AND_GOTO() pattern as used in sl_sntp.c

Please advise how to proceed with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant