Fixing prototype process crash.

A prototype stores linked application processes structures.  When an
application process terminates, it's removed from the list.  To avoid double
removal, the pointer to the next element should be set to NULL.

The issue was introduced in c8790d2a89bb.
This commit is contained in:
Max Romanov
2021-12-01 18:05:50 +03:00
parent 8fb9f7f049
commit 64db3ef1bb
2 changed files with 9 additions and 0 deletions

View File

@@ -52,6 +52,13 @@ fastcgi_finish_request() was called in the OPcache preloading script.
</para> </para>
</change> </change>
<change type="bugfix">
<para>
a prototype process could crash on an application process exit; the bug had
appeared in 1.26.0.
</para>
</change>
</changes> </changes>

View File

@@ -1150,6 +1150,8 @@ nxt_proto_process_remove(nxt_task_t *task, nxt_pid_t pid)
process = lhq.value; process = lhq.value;
nxt_queue_remove(&process->link); nxt_queue_remove(&process->link);
process->link.next = NULL;
break; break;
default: default: