Browse code

sipcapture: fix not to access freed pointer during shut down

(cherry picked from commit 1db6fdf41dbb4b6c95e0f86dfebc4c793858d8b5)

Daniel-Constantin Mierla authored on 14/05/2015 17:21:25
Showing 1 changed files
... ...
@@ -1028,7 +1028,7 @@ static void destroy(void)
1028 1028
 	c = capture_modes_root;
1029 1029
 
1030 1030
 	while (c){
1031
-		c0 = c;
1031
+		c0 = c->next;
1032 1032
 		if (c->name.s){
1033 1033
 			pkg_free(c->name.s);
1034 1034
 		}
... ...
@@ -1043,7 +1043,7 @@ static void destroy(void)
1043 1043
 		}
1044 1044
 
1045 1045
 		pkg_free(c);
1046
-		c = c0->next;
1046
+		c = c0;
1047 1047
 	}
1048 1048
 
1049 1049
 	if (capture_on_flag)