Module: kamailio
Branch: master
Commit: 6232b8ae29988bfe17ddf6e0bd483eec854ab72b
URL:
https://github.com/kamailio/kamailio/commit/6232b8ae29988bfe17ddf6e0bd483ee…
Author: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Date: 2024-11-20T14:19:11+01:00
exec: add fixup_free* to exported functions
---
Modified: src/modules/exec/exec_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6232b8ae29988bfe17ddf6e0bd483ee…
Patch:
https://github.com/kamailio/kamailio/commit/6232b8ae29988bfe17ddf6e0bd483ee…
---
diff --git a/src/modules/exec/exec_mod.c b/src/modules/exec/exec_mod.c
index df5366e3ffa..0fd463de35a 100644
--- a/src/modules/exec/exec_mod.c
+++ b/src/modules/exec/exec_mod.c
@@ -56,6 +56,7 @@ static int w_exec_avp(struct sip_msg *msg, char *cmd, char *avpl);
static int w_exec_cmd(struct sip_msg *msg, char *cmd, char *foo);
static int exec_avp_fixup(void **param, int param_no);
+static int exec_avp_fixup_free(void **param, int param_no);
inline static void exec_shutdown(void);
@@ -64,16 +65,11 @@ inline static void exec_shutdown(void);
* Exported functions
*/
static cmd_export_t cmds[] = {
- {"exec_dset", (cmd_function)w_exec_dset, 1, fixup_spve_null, 0,
- REQUEST_ROUTE|FAILURE_ROUTE},
- {"exec_msg", (cmd_function)w_exec_msg, 1, fixup_spve_null, 0,
- REQUEST_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE},
- {"exec_avp", (cmd_function)w_exec_avp, 1, fixup_spve_null, 0,
- REQUEST_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE},
- {"exec_avp", (cmd_function)w_exec_avp, 2, exec_avp_fixup, 0,
- REQUEST_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE},
- {"exec_cmd", (cmd_function)w_exec_cmd, 1, fixup_spve_null, 0,
- ANY_ROUTE},
+ {"exec_dset", (cmd_function)w_exec_dset, 1, fixup_spve_null,
fixup_free_spve_null, REQUEST_ROUTE|FAILURE_ROUTE},
+ {"exec_msg", (cmd_function)w_exec_msg, 1, fixup_spve_null,
fixup_free_spve_null, REQUEST_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE},
+ {"exec_avp", (cmd_function)w_exec_avp, 1, fixup_spve_null,
fixup_free_spve_null, REQUEST_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE},
+ {"exec_avp", (cmd_function)w_exec_avp, 2, exec_avp_fixup,
exec_avp_fixup_free, REQUEST_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE},
+ {"exec_cmd", (cmd_function)w_exec_cmd, 1, fixup_spve_null,
fixup_free_spve_null, ANY_ROUTE},
{0, 0, 0, 0, 0, 0}
};
@@ -268,6 +264,16 @@ static int exec_avp_fixup(void **param, int param_no)
return 0;
}
+static int exec_avp_fixup_free(void **param, int param_no)
+{
+ if(param_no == 1) {
+ return fixup_free_spve_null(param, 1);
+ } else if(param_no == 2) {
+ free_pvname_list((pvname_list_t *)param);
+ }
+ return 0;
+}
+
static int ki_exec_cmd(sip_msg_t *msg, str *cmd)
{
int ret;