Browse code

core: parser contact - link structure once finishing current one

(cherry picked from commit d6c52a6afdd38cc05a67a25e55e387ad77a9ddf4)
(cherry picked from commit 9ed8820aaf307a756f1f08ccff4459884f62b9a8)
(cherry picked from commit f0d7b3a3d6c2aa27e47c87ec58b31c1527e1f6ff)

Daniel-Constantin Mierla authored on 07/09/2021 08:44:17 • Henning Westerholt committed on 22/10/2021 12:12:10
Showing 1 changed files
... ...
@@ -262,13 +262,14 @@ int parse_contacts(str* _s, contact_t** _c)
262 262
 		_s->len--;
263 263
 		trim_leading(_s);
264 264
 
265
+		c->next = *_c;
266
+		*_c = c;
267
+		c = NULL;
268
+
265 269
 		if (_s->len == 0) {
266 270
 			LM_ERR("text after comma missing\n");
267 271
 			goto error;
268 272
 		}
269
-
270
-		c->next = *_c;
271
-		*_c = c;
272 273
 	}
273 274
 
274 275
 error: