瀏覽代碼

sipcapture: fix not to access freed pointer during shut down

Daniel-Constantin Mierla 10 年之前
父節點
當前提交
1db6fdf41d
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      modules/sipcapture/sipcapture.c

+ 2 - 2
modules/sipcapture/sipcapture.c

@@ -1026,7 +1026,7 @@ static void destroy(void)
 	c = capture_modes_root;
 
 	while (c){
-		c0 = c;
+		c0 = c->next;
 		if (c->name.s){
 			pkg_free(c->name.s);
 		}
@@ -1041,7 +1041,7 @@ static void destroy(void)
 		}
 
 		pkg_free(c);
-		c = c0->next;
+		c = c0;
 	}
 
 	if (capture_on_flag)