Added missing error checking in the C API.

pthread_mutex_init(3) may fail for several reasons, and failing to
check will cause Undefined Behavior when those errors happen.  Add
missing checks, and correctly deinitialize previously created
stuff before exiting from the API.

Signed-off-by: Alejandro Colomar <alx@nginx.com>
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
Reviewed-by: Zhidao HONG <z.hong@f5.com>
This commit is contained in:
Alex Colomar
2022-09-10 18:00:27 +02:00
committed by Alejandro Colomar
parent f8b892e1fa
commit f2213dbd1b
2 changed files with 29 additions and 11 deletions

View File

@@ -177,7 +177,7 @@ the Ruby application process could crash on SIGINT.
<change type="bugfix">
<para>
mutex leak in the C API.
mutex leaks in the C API.
</para>
</change>