# HG changeset patch # User Valentin Bartenev # Date 1397052932 -14400 # Node ID 3633957953840f8675511084d71eb28dcb3a1c5d # Parent e1dcb983d6b3d099192106a966dd1c1deee3751f SPDY: moved a variable initialization near to its check. This should prevent attempts of using pointer before it was checked, since all modern compilers are able to spot access to uninitialized variable. No functional changes. diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c --- a/src/http/ngx_http_spdy.c +++ b/src/http/ngx_http_spdy.c @@ -1412,8 +1412,6 @@ ngx_http_spdy_state_data(ngx_http_spdy_c { ngx_http_spdy_stream_t *stream; - stream = sc->stream; - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0, "spdy DATA frame"); @@ -1441,6 +1439,8 @@ ngx_http_spdy_state_data(ngx_http_spdy_c sc->recv_window = NGX_SPDY_MAX_WINDOW; } + stream = sc->stream; + if (stream == NULL) { return ngx_http_spdy_state_skip(sc, pos, end); }