mirror of
https://github.com/nginx/nginx.git
synced 2024-12-18 21:23:36 -06:00
Stream: fixed possible use of a freed connection.
The session handler may result in session termination, thus a connection pool (from which c->udp was allocated) may be destroyed.
This commit is contained in:
parent
6351d8306f
commit
7e3041b79f
@ -261,7 +261,10 @@ ngx_event_recvmsg(ngx_event_t *ev)
|
||||
|
||||
rev->handler(rev);
|
||||
|
||||
c->udp->buffer = NULL;
|
||||
if (c->udp) {
|
||||
c->udp->buffer = NULL;
|
||||
}
|
||||
|
||||
rev->ready = 0;
|
||||
|
||||
goto next;
|
||||
@ -561,6 +564,8 @@ ngx_delete_udp_connection(void *data)
|
||||
ngx_connection_t *c = data;
|
||||
|
||||
ngx_rbtree_delete(&c->listening->rbtree, &c->udp->node);
|
||||
|
||||
c->udp = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user