Skip to content

Commit 33a5517

Browse files
committed
tweak: fixed some warnings from the clang static code analyzer.
1 parent 4102b82 commit 33a5517

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ngx_http_lua_semaphore.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ ngx_http_lua_alloc_sema(void)
8686
lmcf = ngx_http_cycle_get_module_main_conf(ngx_cycle,
8787
ngx_http_lua_module);
8888

89+
ngx_http_lua_assert(lmcf != NULL);
90+
8991
mm = lmcf->sema_mm;
9092

9193
if (!ngx_queue_empty(&mm->free_queue)) {
@@ -172,6 +174,8 @@ ngx_http_lua_sema_mm_cleanup(void *data)
172174
sem = ngx_queue_data(q, ngx_http_lua_sema_t, chain);
173175
block = sem->block;
174176

177+
ngx_http_lua_assert(block != NULL);
178+
175179
if (block->used == 0) {
176180
iter = (ngx_http_lua_sema_t *) (block + 1);
177181

src/ngx_http_lua_util.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ ngx_http_lua_new_state(lua_State *parent_vm, ngx_cycle_t *cycle,
269269

270270
lua_pushliteral(L, LUA_DEFAULT_PATH ";"); /* package default */
271271
lua_getfield(L, -2, "path"); /* package default old */
272-
old_path = lua_tolstring(L, -1, &old_path_len);
273272
lua_concat(L, 2); /* package new */
274273
lua_setfield(L, -2, "path"); /* package */
275274
#endif

0 commit comments

Comments
 (0)