Module: sip-router
Branch: master
Commit: 2e8ff29fd33ccb6f2da609bec638dbd2d457be08
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2e8ff29…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Apr 22 13:01:41 2014 +0200
xmlrpc: keep pkg for sip message related ops
---
modules/xmlrpc/http.c | 12 ++++++------
modules/xmlrpc/xmlrpc.c | 8 ++++----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/modules/xmlrpc/http.c b/modules/xmlrpc/http.c
index b7bb87f..b15b0f5 100644
--- a/modules/xmlrpc/http.c
+++ b/modules/xmlrpc/http.c
@@ -68,13 +68,13 @@ static int insert_fake_via(sip_msg_t* msg, char* via, int via_len)
struct via_body* vb = 0;
via_cnt++;
- vb = mxr_malloc(sizeof(struct via_body));
+ vb = pkg_malloc(sizeof(struct via_body));
if (vb == 0){
ERR("insert_fake_via: Out of memory\n");
goto error;
}
- msg->h_via1 = mxr_malloc(sizeof(hdr_field_t));
+ msg->h_via1 = pkg_malloc(sizeof(hdr_field_t));
if (!msg->h_via1) {
ERR("No memory left\n");
goto error;
@@ -127,10 +127,10 @@ static int insert_fake_via(sip_msg_t* msg, char* via, int via_len)
error:
if (vb) {
free_via_list(vb);
- mxr_free(vb);
+ pkg_free(vb);
}
- if (msg->h_via1) mxr_free(msg->h_via1);
+ if (msg->h_via1) pkg_free(msg->h_via1);
return -1;
}
@@ -185,12 +185,12 @@ int create_via(sip_msg_t* msg, char* s1, char* s2)
}
if (insert_fake_via(msg, via, via_len) < 0) {
- mxr_free(via);
+ pkg_free(via);
return -1;
}
if (insert_via_lump(msg, via, via_len - CRLF_LEN) < 0) {
- mxr_free(via);
+ pkg_free(via);
return -1;
}
diff --git a/modules/xmlrpc/xmlrpc.c b/modules/xmlrpc/xmlrpc.c
index 41d5901..d36c02c 100644
--- a/modules/xmlrpc/xmlrpc.c
+++ b/modules/xmlrpc/xmlrpc.c
@@ -2130,7 +2130,7 @@ static char* http_xmlrpc2sip(sip_msg_t* msg, int* new_msg_len)
p = new_msg = mxr_malloc(len + 1);
if (new_msg == 0) {
DEBUG("memory allocation failure (%d bytes)\n", len);
- mxr_free(via);
+ pkg_free(via);
return 0;
}
@@ -2158,7 +2158,7 @@ static char* http_xmlrpc2sip(sip_msg_t* msg, int* new_msg_len)
memcpy(p, SIP_MSG_START(msg) + msg->first_line.len,
msg->len - msg->first_line.len);
new_msg[len] = 0; /* null terminate, required by receive_msg() */
- mxr_free(via);
+ pkg_free(via);
*new_msg_len = len;
return new_msg;
}
@@ -2380,11 +2380,11 @@ static int xmlrpc_reply(sip_msg_t* msg, char* p1, char* p2)
if (add_xmlrpc_reply(&reply, &success_suffix) < 0) return -1;
}
if (send_reply(msg, &reply.body) < 0) goto error;
- if (reply.reason) mxr_free(reply.reason);
+ if (reply.reason) pkg_free(reply.reason);
clean_xmlrpc_reply(&reply);
return 1;
error:
- if (reply.reason) mxr_free(reply.reason);
+ if (reply.reason) pkg_free(reply.reason);
clean_xmlrpc_reply(&reply);
return -1;
}