mirror of https://github.com/openresty/openresty
bugfix: nginx did not destroy the cycle memory pool before the daemon process exits.
This is to make the nginx ASAN or Valgrind clean in daemon mode. It is also meaningful when we have more sophisticated cleanup work needed in the configuration initialization phase and handlers like init_by_lua*.pull/403/head
parent
a5e7a17cdf
commit
17384566bb
@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/src/os/unix/ngx_daemon.c b/src/os/unix/ngx_daemon.c
|
||||||
|
index ab672110..f259af31 100644
|
||||||
|
--- a/src/os/unix/ngx_daemon.c
|
||||||
|
+++ b/src/os/unix/ngx_daemon.c
|
||||||
|
@@ -23,6 +23,8 @@ ngx_daemon(ngx_log_t *log)
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
+ /* just to make it ASAN or Valgrind clean */
|
||||||
|
+ ngx_destroy_pool(ngx_cycle->pool);
|
||||||
|
exit(0);
|
||||||
|
}
|
Loading…
Reference in New Issue