From 79dd00cdb3f02868e847c6c20932360c403a73d0 Mon Sep 17 00:00:00 2001 From: Pintu Lohar Date: Tue, 10 Sep 2019 09:14:00 +0200 Subject: [PATCH] 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 (cherry picked from commit 79fecc643d0a17b4de25f54ae269d1bee1f0cb00) --- src/modules/nathelper/nathelper.c | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 src/modules/nathelper/nathelper.c diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c old mode 100644 new mode 100755 index 27015b7bd83..f78878a0b01 --- a/src/modules/nathelper/nathelper.c +++ b/src/modules/nathelper/nathelper.c @@ -1951,6 +1951,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; }