[njs] Added memory exception if alloc fails for njs_vm_function_alloc.

Dmitry Volyntsev xeioex at nginx.com
Fri Dec 3 13:57:16 UTC 2021


details:   https://hg.nginx.org/njs/rev/b27244641dbf
branches:  
changeset: 1756:b27244641dbf
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Dec 03 13:55:11 2021 +0000
description:
Added memory exception if alloc fails for njs_vm_function_alloc.

diffstat:

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

diffs (11 lines):

diff -r 748eca39acb3 -r b27244641dbf src/njs_function.c
--- a/src/njs_function.c	Tue Nov 30 14:55:57 2021 +0000
+++ b/src/njs_function.c	Fri Dec 03 13:55:11 2021 +0000
@@ -72,6 +72,7 @@ njs_vm_function_alloc(njs_vm_t *vm, njs_
 
     function = njs_mp_zalloc(vm->mem_pool, sizeof(njs_function_t));
     if (njs_slow_path(function == NULL)) {
+        njs_memory_error(vm);
         return NULL;
     }
 


More information about the nginx-devel mailing list