Browse code

core: add header helper uses after lump anchor insert

(cherry picked from commit 3ccb1b83216b874405b7a63a73b2966aa7f91253)

Daniel-Constantin Mierla authored on 13/07/2016 08:17:04
Showing 1 changed files
... ...
@@ -743,7 +743,7 @@ int sr_hdr_add(sip_msg_t *msg, str *sname, str *sbody)
743 743
 	struct lump* anchor;
744 744
 	str h;
745 745
 
746
-	h.len = sname->len + 2 + sbody->len + 1 + CRLF_LEN;
746
+	h.len = sname->len + 2 + sbody->len + CRLF_LEN;
747 747
 	h.s = (char*)pkg_malloc(h.len+1);
748 748
 	if(h.s == 0) {
749 749
 		LM_ERR("no more pkg\n");
... ...
@@ -761,7 +761,7 @@ int sr_hdr_add(sip_msg_t *msg, str *sname, str *sbody)
761 761
 	memcpy(h.s+sname->len+2, sbody->s, sbody->len);
762 762
 	memcpy(h.s+sname->len+2+sbody->len, CRLF, CRLF_LEN);
763 763
 	h.s[h.len] = '\0';
764
-	if (insert_new_lump_before(anchor, h.s, h.len, 0) == 0)
764
+	if (insert_new_lump_after(anchor, h.s, h.len, 0) == 0)
765 765
 	{
766 766
 		LM_ERR("cannot insert lump\n");
767 767
 		pkg_free(h.s);