[njs] Removed dead store introduced in 398f4de34fe7.

Dmitry Volyntsev xeioex at nginx.com
Sat May 27 17:06:13 UTC 2023


details:   https://hg.nginx.org/njs/rev/84eadc155d46
branches:  
changeset: 2139:84eadc155d46
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri May 26 20:58:19 2023 -0700
description:
Removed dead store introduced in 398f4de34fe7.

Found by Coverity (CID 1530432).

diffstat:

 src/njs_array.c |  11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diffs (21 lines):

diff -r b9d18d4dd34e -r 84eadc155d46 src/njs_array.c
--- a/src/njs_array.c	Fri May 26 19:43:24 2023 -0700
+++ b/src/njs_array.c	Fri May 26 20:58:19 2023 -0700
@@ -2860,14 +2860,9 @@ njs_sort_indexed_properties(njs_vm_t *vm
                         goto exception;
                     }
 
-                    if (slots != NULL) {
-                        p = (void *) njs_cpymem(newslots, slots,
-                                   sizeof(njs_array_sort_slot_t) * (p - slots));
-                        njs_mp_free(vm->mem_pool, slots);
-
-                    } else {
-                        p = newslots;
-                    }
+                    p = (void *) njs_cpymem(newslots, slots,
+                               sizeof(njs_array_sort_slot_t) * (p - slots));
+                    njs_mp_free(vm->mem_pool, slots);
 
                     slots = newslots;
                     end = slots + nlen;


More information about the nginx-devel mailing list