Module: kamailio
Branch: master
Commit: 3ccb1b83216b874405b7a63a73b2966aa7f91253
URL:
https://github.com/kamailio/kamailio/commit/3ccb1b83216b874405b7a63a73b2966…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-07-13T10:18:49+02:00
core: add header helper uses after lump anchor insert
---
Modified: data_lump.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3ccb1b83216b874405b7a63a73b2966…
Patch:
https://github.com/kamailio/kamailio/commit/3ccb1b83216b874405b7a63a73b2966…
---
diff --git a/data_lump.c b/data_lump.c
index 19a6b90..5d085ec 100644
--- a/data_lump.c
+++ b/data_lump.c
@@ -743,7 +743,7 @@ int sr_hdr_add(sip_msg_t *msg, str *sname, str *sbody)
struct lump* anchor;
str h;
- h.len = sname->len + 2 + sbody->len + 1 + CRLF_LEN;
+ h.len = sname->len + 2 + sbody->len + CRLF_LEN;
h.s = (char*)pkg_malloc(h.len+1);
if(h.s == 0) {
LM_ERR("no more pkg\n");
@@ -761,7 +761,7 @@ int sr_hdr_add(sip_msg_t *msg, str *sname, str *sbody)
memcpy(h.s+sname->len+2, sbody->s, sbody->len);
memcpy(h.s+sname->len+2+sbody->len, CRLF, CRLF_LEN);
h.s[h.len] = '\0';
- if (insert_new_lump_before(anchor, h.s, h.len, 0) == 0)
+ if (insert_new_lump_after(anchor, h.s, h.len, 0) == 0)
{
LM_ERR("cannot insert lump\n");
pkg_free(h.s);