eproxy icon indicating copy to clipboard operation
eproxy copied to clipboard

多次释放资源问题

Open Rtoax opened this issue 5 years ago • 0 comments

因为每次都会讲conn和other添加至全局链表,在关闭过程中遍历链表,此处不应释放两次

void closeconn(int efd, struct conn *conn)
{
	if (conn->other)
		delconn(efd, conn->other);
	delconn(efd, conn);		
}

应该为:

void closeconn(int efd, struct conn *conn)
{
	delconn(efd, conn);		
}

Rtoax avatar Dec 02 '20 10:12 Rtoax