Module: kamailio
Branch: master
Commit: a72f2f01235af073f4aa74e5380136006e568a6e
URL:
https://github.com/kamailio/kamailio/commit/a72f2f01235af073f4aa74e53801360…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-11-20T13:29:47+01:00
userblocklist: add fixup_free* to exported functions
---
Modified: src/modules/userblocklist/userblocklist.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a72f2f01235af073f4aa74e53801360…
Patch:
https://github.com/kamailio/kamailio/commit/a72f2f01235af073f4aa74e53801360…
---
diff --git a/src/modules/userblocklist/userblocklist.c
b/src/modules/userblocklist/userblocklist.c
index 7d63835cb9e..b9b93238a8a 100644
--- a/src/modules/userblocklist/userblocklist.c
+++ b/src/modules/userblocklist/userblocklist.c
@@ -87,6 +87,7 @@ static struct dtrie_node_t *gnode = NULL;
/* ---- fixup functions: */
static int check_blocklist_fixup(void **param, int param_no);
+static int check_blocklist_fixup_free(void **arg, int arg_no);
static int check_user_blocklist_fixup(void **param, int param_no);
static int check_globalblocklist_fixup(void **param, int param_no);
@@ -115,21 +116,21 @@ static void mod_destroy(void);
/* clang-format off */
static cmd_export_t cmds[] = {
{"check_user_blocklist", (cmd_function)check_user_blocklist2, 2,
- check_user_blocklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE},
+ check_user_blocklist_fixup, fixup_free_spve_null, REQUEST_ROUTE | FAILURE_ROUTE},
{"check_user_allowlist", (cmd_function)check_user_allowlist2, 2,
- check_user_blocklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE},
+ check_user_blocklist_fixup, fixup_free_spve_null, REQUEST_ROUTE | FAILURE_ROUTE},
{"check_user_blocklist", (cmd_function)check_user_blocklist3, 3,
- check_user_blocklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE},
+ check_user_blocklist_fixup, fixup_free_spve_null, REQUEST_ROUTE | FAILURE_ROUTE},
{"check_user_allowlist", (cmd_function)check_user_allowlist3, 3,
- check_user_blocklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE},
+ check_user_blocklist_fixup, fixup_free_spve_null, REQUEST_ROUTE | FAILURE_ROUTE},
{"check_user_blocklist", (cmd_function)check_user_blocklist, 4,
- check_user_blocklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE},
+ check_user_blocklist_fixup, fixup_free_spve_null, REQUEST_ROUTE | FAILURE_ROUTE},
{"check_user_allowlist", (cmd_function)check_user_allowlist, 4,
- check_user_blocklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE},
+ check_user_blocklist_fixup, fixup_free_spve_null, REQUEST_ROUTE | FAILURE_ROUTE},
{"check_blocklist", (cmd_function)check_blocklist, 1,
- check_blocklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE},
+ check_blocklist_fixup, check_blocklist_fixup_free, REQUEST_ROUTE | FAILURE_ROUTE},
{"check_allowlist", (cmd_function)check_allowlist, 1,
- check_blocklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE},
+ check_blocklist_fixup, check_blocklist_fixup_free, REQUEST_ROUTE | FAILURE_ROUTE},
{"check_blocklist", (cmd_function)check_globalblocklist, 0,
check_globalblocklist_fixup, 0, REQUEST_ROUTE | FAILURE_ROUTE},
{0, 0, 0, 0, 0, 0}
@@ -614,6 +615,12 @@ static int check_blocklist_fixup(void **arg, int arg_no)
return 0;
}
+static int check_blocklist_fixup_free(void **arg, int arg_no)
+{
+ pkg_free(*arg);
+ return 0;
+}
+
static int ki_check_blocklist(sip_msg_t *msg, str *stable)
{
struct dtrie_node_t *node = NULL;