Destroying pool in case of error.
This closes #233 issue on GitHub. Thanks to 洪志道 (Hong Zhi Dao).
This commit is contained in:
@@ -184,6 +184,7 @@ nxt_controller_start(nxt_task_t *task, void *data)
|
|||||||
|
|
||||||
vldt.pool = nxt_mp_create(1024, 128, 256, 32);
|
vldt.pool = nxt_mp_create(1024, 128, 256, 32);
|
||||||
if (nxt_slow_path(vldt.pool == NULL)) {
|
if (nxt_slow_path(vldt.pool == NULL)) {
|
||||||
|
nxt_mp_destroy(mp);
|
||||||
return NXT_ERROR;
|
return NXT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,14 +53,13 @@ nxt_runtime_create(nxt_task_t *task)
|
|||||||
nxt_app_lang_module_t *lang;
|
nxt_app_lang_module_t *lang;
|
||||||
|
|
||||||
mp = nxt_mp_create(1024, 128, 256, 32);
|
mp = nxt_mp_create(1024, 128, 256, 32);
|
||||||
|
|
||||||
if (nxt_slow_path(mp == NULL)) {
|
if (nxt_slow_path(mp == NULL)) {
|
||||||
return NXT_ERROR;
|
return NXT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
rt = nxt_mp_zget(mp, sizeof(nxt_runtime_t));
|
rt = nxt_mp_zget(mp, sizeof(nxt_runtime_t));
|
||||||
if (nxt_slow_path(rt == NULL)) {
|
if (nxt_slow_path(rt == NULL)) {
|
||||||
return NXT_ERROR;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
task->thread->runtime = rt;
|
task->thread->runtime = rt;
|
||||||
|
|||||||
Reference in New Issue
Block a user