frr icon indicating copy to clipboard operation
frr copied to clipboard

lib,pceplib: fix DNS resolver and PCEP memory leaks

Open jaredmauch opened this issue 5 months ago • 3 comments

Fix memory leaks in DNS resolver and PCEP library:

  • lib/resolver.c: Fix callback leak when VRF switch fails during DNS resolution. Call callback with error before returning to prevent blocking retries in callers like BMP.

  • pceplib/pcep_pcc.c: Replace deprecated gethostbyname2() with getaddrinfo() for proper IPv4/IPv6 support and thread safety.

  • pceplib/test/pcep_pcc_api_test.c: Fix memory leak where pcep_configuration was not freed on DNS resolution error paths.

  • pceplib/pcep_msg_tools.c: Add NULL check to pcep_msg_free_message() to prevent crashes when called with NULL pointer.

jaredmauch avatar Nov 13 '25 05:11 jaredmauch

these must be separate commits they are doing separate things.

donaldsharp avatar Nov 13 '25 14:11 donaldsharp

these must be separate commits they are doing separate things.

These are all related to DNS and the related codebase, so would be nicer to do this as discrete due to the number of bugs that I'm currently seeing in the CICD pipeline which are returning erroneous results. So if you can help get the other fixes merged it becomes much easier to split this if you explicitly want to have the gethostbyname -> getaddrinfo and related changes somehow split out from maybe the one non-explicit dns related commit

jaredmauch avatar Nov 13 '25 18:11 jaredmauch

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Dec 01 '25 21:12 github-actions[bot]