Module: kamailio
Branch: master
Commit: 59dc9b1ba93d4e6a06f87deabf136787a3ab1cf1
URL:
https://github.com/kamailio/kamailio/commit/59dc9b1ba93d4e6a06f87deabf13678…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2023-12-22T09:27:01+01:00
core: fix build warning
core/parser/parse_diversion.c: In function
'parse_diversion_body': core/parser/parse_diversion.c:60:18: warning: the
comparison will always evaluate as 'false' for the address of 'uri_b' will
never be NULL [-Waddress]
60 | if(uri_b == NULL) {
| ^~
core/parser/parse_diversion.c:51:26: note: 'uri_b' declared here
51 | static to_body_t uri_b[NUM_DIVERSION_BODIES]; /*
Temporary storage */
|
---
Modified: src/core/parser/parse_diversion.c
---
Diff:
https://github.com/kamailio/kamailio/commit/59dc9b1ba93d4e6a06f87deabf13678…
Patch:
https://github.com/kamailio/kamailio/commit/59dc9b1ba93d4e6a06f87deabf13678…
---
diff --git a/src/core/parser/parse_diversion.c b/src/core/parser/parse_diversion.c
index 539f6a7bc44..d60d0cbdd1f 100644
--- a/src/core/parser/parse_diversion.c
+++ b/src/core/parser/parse_diversion.c
@@ -55,12 +55,7 @@ int parse_diversion_body(char *buf, int len, diversion_body_t **body)
int i;
to_param_t *params;
- /* Reserves memory max NUM_DIVERSION_BODIES times */
memset(uri_b, 0, NUM_DIVERSION_BODIES * sizeof(to_body_t));
- if(uri_b == NULL) {
- LM_ERR("Error allocating memory for uri_b\n");
- return -1;
- }
tmp = parse_addr_spec(buf, buf + len, &uri_b[num_uri], 1);
if(uri_b[num_uri].error == PARSE_ERROR) {