tiny-nghttpd: Fix memory leak

This commit is contained in:
Tatsuhiro Tsujikawa 2014-11-10 21:20:44 +09:00
parent 94c80e2507
commit 20ffe2b2a0
1 changed files with 11 additions and 0 deletions

View File

@ -372,9 +372,20 @@ static connection* connection_new(int fd)
static void connection_del(connection *conn) static void connection_del(connection *conn)
{ {
stream *strm;
nghttp2_session_del(conn->session); nghttp2_session_del(conn->session);
shutdown(conn->fd, SHUT_WR); shutdown(conn->fd, SHUT_WR);
close(conn->fd); close(conn->fd);
strm = conn->strm_head.next;
while(strm) {
stream *next_strm = strm->next;
stream_del(strm);
strm = next_strm;
}
free(conn); free(conn);
} }