Potential memory leak in check_cookie function in receiver.c
Valgrind report memory leaks in check_cookie function in src/libcharon/network/receiver.c. I was trying to load test my gateway setup. I'm not sure the particular condition but valgrind reported memory leak. I applied the below fix and that seemed to fix the issue.
The code I applied the fix is for 5.0.4.
--- receiver.c.orig 2013-07-29 10:23:51.419625605 -0700
#2 Updated by Tobias Brunner over 7 years ago
- Tracker changed from Issue to Bug
- Category set to libcharon
- Status changed from New to Closed
- Assignee set to Tobias Brunner
- Target version set to 5.1.0
- Resolution set to Fixed
Thanks for the report. There was in fact a memory leak whenever a COOKIE payload was successfully verified.
I changed to code to use the more efficient
get_packet_data method, thus, avoiding the cloned packet and preventing the memory leak.