Module: kamailio Branch: master Commit: 79fecc643d0a17b4de25f54ae269d1bee1f0cb00 URL: https://github.com/kamailio/kamailio/commit/79fecc643d0a17b4de25f54ae269d1be...
Author: Pintu Lohar plohar@sk.com Committer: Henning Westerholt hw@skalatan.de Date: 2019-09-10T09:15:26+02:00
nathelper: Fixed memory leak in nathelper fetch contact timer (GH #2062)
- Allocated buffer is not freed when contact fetch is failed - Leak frequently occur when database disconnect and reconnect
---
Modified: src/modules/nathelper/nathelper.c
---
Diff: https://github.com/kamailio/kamailio/commit/79fecc643d0a17b4de25f54ae269d1be... Patch: https://github.com/kamailio/kamailio/commit/79fecc643d0a17b4de25f54ae269d1be...
---
diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c old mode 100644 new mode 100755 index 4426b93478..e77c9470a8 --- a/src/modules/nathelper/nathelper.c +++ b/src/modules/nathelper/nathelper.c @@ -2003,6 +2003,8 @@ static void nh_timer(unsigned int ticks, void *timer_idx) + iteration, natping_processes * natping_interval, options); if(rval < 0) { + if(buf != NULL) + pkg_free(buf); LM_ERR("failed to fetch contacts\n"); goto done; }