[sr-dev] git:master:21816a11: topos: free old outbound buffer inside SREV_NET_DATA_OUT callback
Daniel-Constantin Mierla
miconda at gmail.com
Mon Aug 12 11:19:14 CEST 2019
Module: kamailio
Branch: master
Commit: 21816a11a56628a9eee17765645fcf03d57929bd
URL: https://github.com/kamailio/kamailio/commit/21816a11a56628a9eee17765645fcf03d57929bd
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-08-12T11:17:33+02:00
topos: free old outbound buffer inside SREV_NET_DATA_OUT callback
- GH #2027
---
Modified: src/modules/topos/topos_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/21816a11a56628a9eee17765645fcf03d57929bd.diff
Patch: https://github.com/kamailio/kamailio/commit/21816a11a56628a9eee17765645fcf03d57929bd.patch
---
diff --git a/src/modules/topos/topos_mod.c b/src/modules/topos/topos_mod.c
index f6b6a3a2f5..942c545d58 100644
--- a/src/modules/topos/topos_mod.c
+++ b/src/modules/topos/topos_mod.c
@@ -390,6 +390,7 @@ int tps_msg_sent(sr_event_param_t *evp)
str *obuf;
int dialog;
int local;
+ str nbuf = STR_NULL;
obuf = (str*)evp->data;
@@ -443,7 +444,15 @@ int tps_msg_sent(sr_event_param_t *evp)
tps_response_sent(&msg);
}
- obuf->s = tps_msg_update(&msg, (unsigned int*)&obuf->len);
+ nbuf.s = tps_msg_update(&msg, (unsigned int*)&nbuf.len);
+ if(nbuf.s!=NULL) {
+ LM_DBG("new outbound buffer generated\n");
+ pkg_free(obuf->s);
+ obuf->s = nbuf.s;
+ obuf->len = nbuf.len;
+ } else {
+ LM_ERR("failed to generate new outbound buffer\n");
+ }
done:
free_sip_msg(&msg);
More information about the sr-dev
mailing list