Module: kamailio
Branch: master
Commit: 78594dbf653b46d24cc7eaa26ff28b43b0c024ce
URL:
https://github.com/kamailio/kamailio/commit/78594dbf653b46d24cc7eaa26ff28b4…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-12-11T21:49:06+01:00
pipelimit: add fixup_free* to exported functions
---
Modified: src/modules/pipelimit/pipelimit.c
---
Diff:
https://github.com/kamailio/kamailio/commit/78594dbf653b46d24cc7eaa26ff28b4…
Patch:
https://github.com/kamailio/kamailio/commit/78594dbf653b46d24cc7eaa26ff28b4…
---
diff --git a/src/modules/pipelimit/pipelimit.c b/src/modules/pipelimit/pipelimit.c
index a632a4cda51..10641ebed00 100644
--- a/src/modules/pipelimit/pipelimit.c
+++ b/src/modules/pipelimit/pipelimit.c
@@ -132,18 +132,22 @@ static int w_pl_drop_forced(struct sip_msg *, char *, char *);
static int w_pl_drop(struct sip_msg *, char *, char *);
static void destroy(void);
static int fixup_pl_check3(void **param, int param_no);
+static int fixup_free_pl_check3(void **param, int param_no);
/* clang-format off */
static cmd_export_t cmds[] = {
- {"pl_check", (cmd_function)w_pl_check, 1, fixup_spve_null, 0, ANY_ROUTE},
- {"pl_check", (cmd_function)w_pl_check3, 3, fixup_pl_check3, 0, ANY_ROUTE},
- {"pl_active", (cmd_function)w_pl_active, 1, fixup_spve_null, 0, ANY_ROUTE},
- {"pl_drop", (cmd_function)w_pl_drop_default, 0, 0, 0,
- REQUEST_ROUTE | BRANCH_ROUTE | FAILURE_ROUTE | ONSEND_ROUTE},
- {"pl_drop", (cmd_function)w_pl_drop_forced, 1, fixup_uint_null, 0,
- REQUEST_ROUTE | BRANCH_ROUTE | FAILURE_ROUTE | ONSEND_ROUTE},
- {"pl_drop", (cmd_function)w_pl_drop, 2, fixup_uint_uint, 0,
- REQUEST_ROUTE | BRANCH_ROUTE | FAILURE_ROUTE | ONSEND_ROUTE},
+ {"pl_check", (cmd_function)w_pl_check, 1,
+ fixup_spve_null, fixup_free_spve_null, ANY_ROUTE},
+ {"pl_check", (cmd_function)w_pl_check3, 3,
+ fixup_pl_check3, fixup_free_pl_check3, ANY_ROUTE},
+ {"pl_active", (cmd_function)w_pl_active, 1,
+ fixup_spve_null, fixup_free_spve_null, ANY_ROUTE},
+ {"pl_drop", (cmd_function)w_pl_drop_default, 0,
+ 0, 0, REQUEST_ROUTE | BRANCH_ROUTE | FAILURE_ROUTE | ONSEND_ROUTE},
+ {"pl_drop", (cmd_function)w_pl_drop_forced, 1,
+ fixup_uint_null, 0, REQUEST_ROUTE | BRANCH_ROUTE | FAILURE_ROUTE | ONSEND_ROUTE},
+ {"pl_drop", (cmd_function)w_pl_drop, 2,
+ fixup_uint_uint, 0, REQUEST_ROUTE | BRANCH_ROUTE | FAILURE_ROUTE | ONSEND_ROUTE},
{0, 0, 0, 0, 0, 0}
};
@@ -689,6 +693,17 @@ static int fixup_pl_check3(void **param, int param_no)
return 0;
}
+static int fixup_free_pl_check3(void **param, int param_no)
+{
+ if(param_no == 1)
+ return fixup_free_spve_null(param, 1);
+ if(param_no == 2)
+ return fixup_free_spve_null(param, 1);
+ if(param_no == 3)
+ return fixup_free_igp_null(param, 1);
+ return 0;
+}
+
static int pl_active(sip_msg_t *msg, str *pipeid)
{
pl_pipe_t *pipe = NULL;