Browse code

Merge 96e1f7213e17ac8da8f19abcccdd81dfe649c092 into d52f60173be34c5c1581c762444b5e26c57b097a

Alex Hermann authored on 20/10/2020 14:57:37 • GitHub committed on 20/10/2020 14:57:37
Showing 1 changed files
... ...
@@ -44,7 +44,6 @@ int jsonrpc_request(struct sip_msg* _m,
44 44
 	str params;
45 45
 	str options;
46 46
 	str route;
47
-	param_hooks_t phooks;
48 47
 	param_t* pit=NULL;
49 48
 	param_t* freeme=NULL;
50 49
 	int retry;
... ...
@@ -85,7 +84,7 @@ int jsonrpc_request(struct sip_msg* _m,
85 84
 			options.len--;
86 85
 		}
87 86
 
88
-		if (parse_params(&options, CLASS_ANY, &phooks, &pit)<0) {
87
+		if (parse_params(&options, CLASS_ANY, NULL, &pit)<0) {
89 88
 			ERR("failed parsing params value\n");
90 89
 			return -1;
91 90
 		}
... ...
@@ -95,8 +94,7 @@ int jsonrpc_request(struct sip_msg* _m,
95 94
 		for (; pit;pit=pit->next)
96 95
 		{
97 96
 			if PIT_MATCHES("route") {
98
-				pkg_str_dup(&route, &pit->body);
99
-				CHECK_MALLOC_GOTO(route.s, end);
97
+				route = pit->body;
100 98
 
101 99
 			} else if PIT_MATCHES("timeout") {
102 100
 				timeout = atoi(pit->body.s);
... ...
@@ -123,8 +121,6 @@ skip_parse:
123 121
 		goto end;
124 122
 	}
125 123
 
126
-	retval = 0;
127
-
128 124
 	retval = mod_jsonrpc_request(
129 125
 		_m,                     /* sip_msg */
130 126
 		conn,                   /* connection group */
... ...
@@ -138,7 +134,6 @@ skip_parse:
138 134
 
139 135
 end:
140 136
 	if(freeme) free_params(freeme);
141
-	if(route.s) pkg_free(route.s);
142 137
 	return retval;
143 138
 }
144 139