Skip to content

Commit

Permalink
fix: log ref segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
alonbg committed Sep 19, 2016
1 parent fa2489f commit 4c78f78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/ngx_stream_lua_shdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,15 @@ ngx_stream_lua_shdict_expire(ngx_stream_lua_shdict_ctx_t *ctx, ngx_uint_t n)


void
ngx_stream_lua_inject_shdict_api(ngx_stream_lua_main_conf_t *lmcf, lua_State *L)
ngx_stream_lua_inject_shdict_api(ngx_log_t *log,
ngx_stream_lua_main_conf_t *lmcf, lua_State *L)
{
ngx_uint_t i;
ngx_array_t all_zones;
ngx_stream_lua_shdict_ctx_t *ctx;
ngx_shm_zone_t **zone, *shm_zone;
ngx_pool_t *temp_pool;
ngx_list_part_t *part;
ngx_log_t *log;

log = &lmcf->cycle->log;

/* place http and stream zones in a single array */
temp_pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, log);
Expand Down
4 changes: 2 additions & 2 deletions src/ngx_stream_lua_shdict.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ typedef struct {
ngx_int_t ngx_stream_lua_shdict_init_zone(ngx_shm_zone_t *shm_zone, void *data);
void ngx_stream_lua_shdict_rbtree_insert_value(ngx_rbtree_node_t *temp,
ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel);
void ngx_stream_lua_inject_shdict_api(ngx_stream_lua_main_conf_t *lmcf,
lua_State *L);
void ngx_stream_lua_inject_shdict_api(ngx_log_t *log,
ngx_stream_lua_main_conf_t *lmcf, lua_State *L);


#endif /* _NGX_STREAM_LUA_SHDICT_H_INCLUDED_ */
Expand Down
2 changes: 1 addition & 1 deletion src/ngx_stream_lua_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2674,7 +2674,7 @@ ngx_stream_lua_inject_ngx_api(lua_State *L, ngx_stream_lua_main_conf_t *lmcf,

ngx_stream_lua_inject_req_api(log, L);
ngx_stream_lua_inject_variable_api(L);
ngx_stream_lua_inject_shdict_api(lmcf, L);
ngx_stream_lua_inject_shdict_api(log, lmcf, L);
ngx_stream_lua_inject_socket_tcp_api(log, L);
ngx_stream_lua_inject_socket_udp_api(log, L);
ngx_stream_lua_inject_uthread_api(log, L);
Expand Down

0 comments on commit 4c78f78

Please sign in to comment.