Pool may not be created if connection was created but rejected in connect()
call. Make sure to check if it is here before trying to destroy it.
}
#endif
- ngx_destroy_pool(u->peer.connection->pool);
+ if (u->peer.connection->pool) {
+ ngx_destroy_pool(u->peer.connection->pool);
+ }
+
ngx_close_connection(u->peer.connection);
}
"close http upstream connection: %d",
u->peer.connection->fd);
- ngx_destroy_pool(u->peer.connection->pool);
+ if (u->peer.connection->pool) {
+ ngx_destroy_pool(u->peer.connection->pool);
+ }
+
ngx_close_connection(u->peer.connection);
}