Module: kamailio
Branch: master
Commit: 82e653c026219704a4c065e9a523f88c214b2faf
URL:
https://github.com/kamailio/kamailio/commit/82e653c026219704a4c065e9a523f88…
Author: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Date: 2024-11-20T14:19:11+01:00
corex: add fixup_free to file_read function
---
Modified: src/modules/corex/corex_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/82e653c026219704a4c065e9a523f88…
Patch:
https://github.com/kamailio/kamailio/commit/82e653c026219704a4c065e9a523f88…
---
diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c
index a6f06a2f26b..0fdf35060ea 100644
--- a/src/modules/corex/corex_mod.c
+++ b/src/modules/corex/corex_mod.c
@@ -79,6 +79,7 @@ static int w_is_faked_msg(sip_msg_t *msg, char *p1, char *p2);
static int w_is_socket_name(sip_msg_t *msg, char *psockname, char *p2);
static int fixup_file_op(void **param, int param_no);
+static int fixup_free_file_op(void **param, int param_no);
static sr_kemi_xval_t _sr_kemi_corex_xval = {0};
static str corex_evcb_reply_out = STR_NULL;
@@ -148,7 +149,7 @@ static cmd_export_t cmds[] = {
{"msg_iflag_is_set", (cmd_function)w_msg_iflag_is_set, 1,
fixup_spve_null, fixup_free_spve_null, ANY_ROUTE},
{"file_read", (cmd_function)w_file_read, 2,
- fixup_file_op, 0, ANY_ROUTE},
+ fixup_file_op, fixup_free_file_op, ANY_ROUTE},
{"file_write", (cmd_function)w_file_write, 2,
fixup_spve_spve, fixup_free_spve_spve, ANY_ROUTE},
{"setxflag", (cmd_function)w_setxflag, 1,
@@ -911,6 +912,23 @@ static int fixup_file_op(void **param, int param_no)
return -1;
}
+/**
+ *
+ */
+static int fixup_free_file_op(void **param, int param_no)
+{
+ if(param_no == 1) {
+ return fixup_free_spve_null(param, 1);
+ }
+
+ if(param_no == 2) {
+ return fixup_free_pvar_null(param, 1);
+ }
+
+ LM_ERR("invalid parameter number <%d>\n", param_no);
+ return -1;
+}
+
/**
*
*/