[sr-dev] git:master:f409a8c9: tm: cleanup parsed body at the end t_continue_helper

Daniel-Constantin Mierla miconda at gmail.com
Wed Dec 7 14:14:50 CET 2022


Module: kamailio
Branch: master
Commit: f409a8c9f6fde33eaf8b428887e219b56740b0a5
URL: https://github.com/kamailio/kamailio/commit/f409a8c9f6fde33eaf8b428887e219b56740b0a5

Author: Rick Barenthin <rick at ng-voice.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-12-07T14:14:42+01:00

tm: cleanup parsed body at the end t_continue_helper

- if t_suspend and t_continue are used for replies
  and in the called route in t_continue the body of
  the sip message is parsed the pkg memory of the
  parsed body is leaked

---

Modified: src/modules/tm/t_suspend.c

---

Diff:  https://github.com/kamailio/kamailio/commit/f409a8c9f6fde33eaf8b428887e219b56740b0a5.diff
Patch: https://github.com/kamailio/kamailio/commit/f409a8c9f6fde33eaf8b428887e219b56740b0a5.patch

---

diff --git a/src/modules/tm/t_suspend.c b/src/modules/tm/t_suspend.c
index f0255d6647..4e25c3c89b 100644
--- a/src/modules/tm/t_suspend.c
+++ b/src/modules/tm/t_suspend.c
@@ -554,6 +554,11 @@ static int t_continue_helper(unsigned int hash_index, unsigned int label,
 					hdr = hdr->next;
 				}
 			}
+
+			/* trigger free of body */
+			if(brpl->body && brpl->body->free) {
+				brpl->body->free(&brpl->body);
+			}
 			sip_msg_free(brpl);
 		}
 	}




More information about the sr-dev mailing list