Skip to content

Commit 4c78f78

Browse files
author
alonbg
committed
fix: log ref segfault
1 parent fa2489f commit 4c78f78

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Diff for: src/ngx_stream_lua_shdict.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -307,17 +307,15 @@ ngx_stream_lua_shdict_expire(ngx_stream_lua_shdict_ctx_t *ctx, ngx_uint_t n)
307307

308308

309309
void
310-
ngx_stream_lua_inject_shdict_api(ngx_stream_lua_main_conf_t *lmcf, lua_State *L)
310+
ngx_stream_lua_inject_shdict_api(ngx_log_t *log,
311+
ngx_stream_lua_main_conf_t *lmcf, lua_State *L)
311312
{
312313
ngx_uint_t i;
313314
ngx_array_t all_zones;
314315
ngx_stream_lua_shdict_ctx_t *ctx;
315316
ngx_shm_zone_t **zone, *shm_zone;
316317
ngx_pool_t *temp_pool;
317318
ngx_list_part_t *part;
318-
ngx_log_t *log;
319-
320-
log = &lmcf->cycle->log;
321319

322320
/* place http and stream zones in a single array */
323321
temp_pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, log);

Diff for: src/ngx_stream_lua_shdict.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ typedef struct {
4444
ngx_int_t ngx_stream_lua_shdict_init_zone(ngx_shm_zone_t *shm_zone, void *data);
4545
void ngx_stream_lua_shdict_rbtree_insert_value(ngx_rbtree_node_t *temp,
4646
ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel);
47-
void ngx_stream_lua_inject_shdict_api(ngx_stream_lua_main_conf_t *lmcf,
48-
lua_State *L);
47+
void ngx_stream_lua_inject_shdict_api(ngx_log_t *log,
48+
ngx_stream_lua_main_conf_t *lmcf, lua_State *L);
4949

5050

5151
#endif /* _NGX_STREAM_LUA_SHDICT_H_INCLUDED_ */

Diff for: src/ngx_stream_lua_util.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2674,7 +2674,7 @@ ngx_stream_lua_inject_ngx_api(lua_State *L, ngx_stream_lua_main_conf_t *lmcf,
26742674

26752675
ngx_stream_lua_inject_req_api(log, L);
26762676
ngx_stream_lua_inject_variable_api(L);
2677-
ngx_stream_lua_inject_shdict_api(lmcf, L);
2677+
ngx_stream_lua_inject_shdict_api(log, lmcf, L);
26782678
ngx_stream_lua_inject_socket_tcp_api(log, L);
26792679
ngx_stream_lua_inject_socket_udp_api(log, L);
26802680
ngx_stream_lua_inject_uthread_api(log, L);

0 commit comments

Comments
 (0)