Initialization of the action object made more consistent.

This commit is contained in:
Valentin Bartenev
2020-03-27 17:22:52 +03:00
parent 8532cf6ae6
commit 5f9c4754cb

View File

@@ -432,8 +432,6 @@ nxt_http_route_match_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
return NULL; return NULL;
} }
match->action.u.route = NULL;
match->action.handler = NULL;
match->items = n; match->items = n;
action_conf = nxt_conf_get_path(cv, &action_path); 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; return ret;
} }
nxt_memzero(action, sizeof(nxt_http_action_t));
conf = accf.pass; conf = accf.pass;
if (accf.share != NULL) { 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) { 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)) { if (nxt_slow_path(action->u.fallback == NULL)) {
return NXT_ERROR; return NXT_ERROR;
} }