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

Author: Victor Seva <linuxman...@torreviejawireless.org>
Committer: Victor Seva <linuxman...@torreviejawireless.org>
Date: 2024-11-20T12:04:27+01:00

xcap_server: add fixup_free* to exported functions

---

Modified: src/modules/xcap_server/xcap_server.c

---

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

---

diff --git a/src/modules/xcap_server/xcap_server.c 
b/src/modules/xcap_server/xcap_server.c
index 6feef732117..31d3771ec3d 100644
--- a/src/modules/xcap_server/xcap_server.c
+++ b/src/modules/xcap_server/xcap_server.c
@@ -64,6 +64,7 @@ static int w_xcaps_put(sip_msg_t *msg, char *puri, char 
*ppath, char *pbody);
 static int w_xcaps_get(sip_msg_t *msg, char *puri, char *ppath);
 static int w_xcaps_del(sip_msg_t *msg, char *puri, char *ppath);
 static int fixup_xcaps_put(void **param, int param_no);
+static int fixup_free_xcaps_put(void **param, int param_no);
 static int check_preconditions(sip_msg_t *msg, str etag_hdr);
 static int check_match_header(str body, str *etag);
 
@@ -125,9 +126,9 @@ static param_export_t params[] = {
 };
 
 static cmd_export_t cmds[] = {
-       {"xcaps_put", (cmd_function)w_xcaps_put, 3, fixup_xcaps_put, 0, 
REQUEST_ROUTE},
-       {"xcaps_get", (cmd_function)w_xcaps_get, 2, fixup_xcaps_put, 0, 
REQUEST_ROUTE},
-       {"xcaps_del", (cmd_function)w_xcaps_del, 2, fixup_xcaps_put, 0, 
REQUEST_ROUTE},
+       {"xcaps_put", (cmd_function)w_xcaps_put, 3, fixup_xcaps_put, 
fixup_free_xcaps_put, REQUEST_ROUTE},
+       {"xcaps_get", (cmd_function)w_xcaps_get, 2, fixup_xcaps_put, 
fixup_free_xcaps_put, REQUEST_ROUTE},
+       {"xcaps_del", (cmd_function)w_xcaps_del, 2, fixup_xcaps_put, 
fixup_free_xcaps_put, REQUEST_ROUTE},
        {0, 0, 0, 0, 0, 0}
 };
 
@@ -1495,6 +1496,21 @@ static int fixup_xcaps_put(void **param, int param_no)
        return 0;
 }
 
+/**
+ *
+ */
+static int fixup_free_xcaps_put(void **param, int param_no)
+{
+       if(param_no == 1) {
+               return fixup_free_spve_null(param, 1);
+       } else if(param_no == 2) {
+               return fixup_free_spve_null(param, 1);
+       } else if(param_no == 3) {
+               pv_elem_free_all((pv_elem_t *)*param);
+       }
+       return 0;
+}
+
 static int check_preconditions(sip_msg_t *msg, str etag_hdr)
 {
        struct hdr_field *hdr = msg->headers;

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to