]> git.kaiwu.me - nginx.git/commit
Fixed error handling in ngx_event_connect_peer().
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 30 Jan 2012 11:12:52 +0000 (11:12 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 30 Jan 2012 11:12:52 +0000 (11:12 +0000)
commit4a23bc57051187362094c1f41793901805ac55c2
tree812f310b9cb5392d8e593e861fa6696d75ef827d
parentb06200f3dc071a60ceadbfc65577086ba4626cbd
Fixed error handling in ngx_event_connect_peer().

Previously if ngx_add_event() failed a connection was freed two times (once
in the ngx_event_connect_peer(), and again by a caller) as pc->connection was
left set.  Fix is to always use ngx_close_connection() to close connection
properly and set pc->connection to NULL on errors.

Patch by Piotr Sikora.
src/event/ngx_event_connect.c