Browse code

core: Fix crash in xavp.c

- Inserting an xavp into a list can crash when inserting XTYPE_NULL padding entries

Hugh Waite authored on 18/05/2015 16:00:08
Showing 1 changed files
... ...
@@ -723,8 +723,7 @@ int xavp_insert(sr_xavp_t *xavp, int idx, sr_xavp_t **list)
723 723
 		if(crt==NULL)
724 724
 			return -1;
725 725
 		if (lst == NULL) {
726
-			crt->next = *list;
727
-			*list = crt;
726
+			xavp_add(crt, list);
728 727
 		} else {
729 728
 			crt->next = lst->next;
730 729
 			lst->next = crt;