[sr-dev] git:master:c1b4d442: core: parse_ppi_pai - free header parameters for PAI and PPI

Daniel-Constantin Mierla miconda at gmail.com
Thu Jan 15 14:30:46 CET 2015


Module: kamailio
Branch: master
Commit: c1b4d442501591bd18e8130474eeb5c16101e549
URL: https://github.com/kamailio/kamailio/commit/c1b4d442501591bd18e8130474eeb5c16101e549

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-01-15T13:42:13+01:00

core: parse_ppi_pai - free header parameters for PAI and PPI

- they are not considere in the compacted p_id_body_t and not freed
- specs don't mention headers parameters for PAI and PPI, but could come
  as UA extensions

---

Modified: parser/parse_ppi_pai.c

---

Diff:  https://github.com/kamailio/kamailio/commit/c1b4d442501591bd18e8130474eeb5c16101e549.diff
Patch: https://github.com/kamailio/kamailio/commit/c1b4d442501591bd18e8130474eeb5c16101e549.patch

---

diff --git a/parser/parse_ppi_pai.c b/parser/parse_ppi_pai.c
index db50dc9..a82b50e 100644
--- a/parser/parse_ppi_pai.c
+++ b/parser/parse_ppi_pai.c
@@ -62,6 +62,8 @@ int parse_pai_ppi_body(char *buf, int len, p_id_body_t **body)
 		LM_ERR("Error parsing PAI/PPI body %u '%.*s'\n", num_uri, len, buf);
 		return -1;
 	}
+	/* should be no header params, but in case there are, free them */
+	free_to_params(&uri_b[num_uri]);
 	num_uri++;
 	while ((*tmp == ',') && (num_uri < NUM_PAI_BODIES))
 	{
@@ -72,6 +74,8 @@ int parse_pai_ppi_body(char *buf, int len, p_id_body_t **body)
 			LM_ERR("Error parsing PAI/PPI body %u '%.*s'\n", num_uri, len, buf);
 			return -1;
 		}
+		/* should be no header params, but in case there are, free them */
+		free_to_params(&uri_b[num_uri]);
 		num_uri++;
 	}
 	if (num_uri >= NUM_PAI_BODIES)




More information about the sr-dev mailing list