fix accidental corrdump

zjd zjd5536 at 163.com
Tue Sep 27 07:25:18 UTC 2022


# HG changeset patch

# User Zhang Jinde <zjd5536 at 163.com>

# Date 1664261587 -28800

#      Tue Sep 27 14:53:07 2022 +0800

# Node ID 226a75a3703db612ed13d4357ac1b71faef6974a

# Parent  ba5cf8f73a2d0a3615565bf9545f3d65216a0530

Core: fix ngx_reset_pool wild pointer's coredump



When frequently  use ngx_reset_pool and use memory to the same pool in a worker,  it hanpens to accidental corrdump sometimes.



diff -r ba5cf8f73a2d -r 226a75a3703d src/core/ngx_palloc.c

--- a/src/core/ngx_palloc.c     Thu Sep 08 13:53:49 2022 +0400

+++ b/src/core/ngx_palloc.c     Tue Sep 27 14:53:07 2022 +0800

@@ -105,6 +105,7 @@

     for (l = pool->large; l; l = l->next) {

         if (l->alloc) {

             ngx_free(l->alloc);

+            l->alloc = NULL;

         }

     }


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20220927/31cb5112/attachment.htm>


More information about the nginx mailing list