Skip to content

Commit 458994e

Browse files
committed
bugfix: fixed a ctx nullity test caught by cppcheck and reported by Ilya Shipitsin in #17.
1 parent da5f3c3 commit 458994e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ngx_stream_lua_util.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,17 +561,17 @@ ngx_stream_lua_session_cleanup(ngx_stream_lua_ctx_t *ctx, int forcible)
561561
ngx_stream_session_t *s;
562562
ngx_stream_lua_main_conf_t *lmcf;
563563

564-
s = ctx->session;
565-
566-
ngx_log_debug1(NGX_LOG_DEBUG_STREAM, s->connection->log, 0,
567-
"stream lua session cleanup: forcible=%d", forcible);
568-
569564
/* force coroutine handling the session quit */
570565
if (ctx == NULL) {
571566
dd("ctx is NULL");
572567
return;
573568
}
574569

570+
s = ctx->session;
571+
572+
ngx_log_debug1(NGX_LOG_DEBUG_STREAM, s->connection->log, 0,
573+
"stream lua session cleanup: forcible=%d", forcible);
574+
575575
lmcf = ngx_stream_get_module_main_conf(s, ngx_stream_lua_module);
576576

577577
#if 1

0 commit comments

Comments
 (0)