From 30396d8b455f9342d1edeb7acca259e48cd459d8 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Fri, 26 May 2023 20:58:19 -0700 Subject: [PATCH] Removed dead store introduced in 398f4de34fe7. Found by Coverity (CID 1530432). --- src/njs_array.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/njs_array.c b/src/njs_array.c index aa9447c3..f87abd87 100644 --- a/src/njs_array.c +++ b/src/njs_array.c @@ -2860,14 +2860,9 @@ njs_sort_indexed_properties(njs_vm_t *vm, njs_value_t *obj, int64_t length, 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; -- 2.47.3