[sr-dev] git:master:d6c52a6a: core: parser contact - link structure once finishing current one

Daniel-Constantin Mierla miconda at gmail.com
Tue Sep 7 10:51:05 CEST 2021


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-09-07T10:50:40+02:00

core: parser contact - link structure once finishing current one

---

Modified: src/core/parser/contact/contact.c

---

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

---

diff --git a/src/core/parser/contact/contact.c b/src/core/parser/contact/contact.c
index 650740b1a1..8c6ebdd6bb 100644
--- a/src/core/parser/contact/contact.c
+++ b/src/core/parser/contact/contact.c
@@ -262,13 +262,14 @@ int parse_contacts(str* _s, contact_t** _c)
 		_s->len--;
 		trim_leading(_s);
 
+		c->next = *_c;
+		*_c = c;
+		c = NULL;
+
 		if (_s->len == 0) {
 			LM_ERR("text after comma missing\n");
 			goto error;
 		}
-
-		c->next = *_c;
-		*_c = c;
 	}
 
 error:




More information about the sr-dev mailing list