Destroying pool in case of error.

This closes #233 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
This commit is contained in:
Max Romanov
2019-03-22 15:32:40 +03:00
parent 687f83fbd0
commit 1b7514dca3
2 changed files with 2 additions and 2 deletions

View File

@@ -184,6 +184,7 @@ nxt_controller_start(nxt_task_t *task, void *data)
vldt.pool = nxt_mp_create(1024, 128, 256, 32);
if (nxt_slow_path(vldt.pool == NULL)) {
nxt_mp_destroy(mp);
return NXT_ERROR;
}

View File

@@ -53,14 +53,13 @@ nxt_runtime_create(nxt_task_t *task)
nxt_app_lang_module_t *lang;
mp = nxt_mp_create(1024, 128, 256, 32);
if (nxt_slow_path(mp == NULL)) {
return NXT_ERROR;
}
rt = nxt_mp_zget(mp, sizeof(nxt_runtime_t));
if (nxt_slow_path(rt == NULL)) {
return NXT_ERROR;
goto fail;
}
task->thread->runtime = rt;