[nginx] Core: fixed memory leak on error, missed in c3f60d618c17.

Maxim Dounin mdounin at mdounin.ru
Fri Jul 19 15:16:12 UTC 2019


details:   https://hg.nginx.org/nginx/rev/eb9c7fb796d5
branches:  
changeset: 7541:eb9c7fb796d5
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Fri Jul 19 17:50:00 2019 +0300
description:
Core: fixed memory leak on error, missed in c3f60d618c17.

Found by Coverity (CID 1451664).

diffstat:

 src/core/ngx_hash.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff --git a/src/core/ngx_hash.c b/src/core/ngx_hash.c
--- a/src/core/ngx_hash.c
+++ b/src/core/ngx_hash.c
@@ -358,6 +358,7 @@ found:
                           "could not build %s, you should "
                           "increase %s_max_size: %i",
                           hinit->name, hinit->name, hinit->max_size);
+            ngx_free(test);
             return NGX_ERROR;
         }
 


More information about the nginx-devel mailing list