From 5f9c4754cbb1dfec0156b4473d1b31a4da8a3e3d Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 27 Mar 2020 17:22:52 +0300 Subject: Initialization of the action object made more consistent. --- src/nxt_http_route.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nxt_http_route.c b/src/nxt_http_route.c index d7f20bcb..ffa5f6e7 100644 --- a/src/nxt_http_route.c +++ b/src/nxt_http_route.c @@ -432,8 +432,6 @@ nxt_http_route_match_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, return NULL; } - match->action.u.route = NULL; - match->action.handler = NULL; match->items = n; action_conf = nxt_conf_get_path(cv, &action_path); @@ -613,6 +611,8 @@ nxt_http_route_action_create(nxt_router_temp_conf_t *tmcf, nxt_conf_value_t *cv, return ret; } + nxt_memzero(action, sizeof(nxt_http_action_t)); + conf = accf.pass; if (accf.share != NULL) { @@ -633,7 +633,7 @@ nxt_http_route_action_create(nxt_router_temp_conf_t *tmcf, nxt_conf_value_t *cv, } if (accf.fallback != NULL) { - action->u.fallback = nxt_mp_zalloc(mp, sizeof(nxt_http_action_t)); + action->u.fallback = nxt_mp_alloc(mp, sizeof(nxt_http_action_t)); if (nxt_slow_path(action->u.fallback == NULL)) { return NXT_ERROR; } -- cgit