From 51979d11f576c480bc5729a6adea6ac9fed57216 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Fri, 25 Mar 2022 11:16:45 +0100 Subject: [PATCH] Fix `getMany()` memory leak (#804) Ref https://github.com/Level/rocksdb/issues/192 Ref https://github.com/Level/leveldown/issues/790 --- binding.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/binding.cc b/binding.cc index d6394c34..c30ac76f 100644 --- a/binding.cc +++ b/binding.cc @@ -260,6 +260,7 @@ static std::vector* KeyArray (napi_env env, napi_value arr) { StringOrBufferLength(env, element) > 0) { LD_STRING_OR_BUFFER_TO_COPY(env, element, to); result->emplace_back(toCh_, toSz_); + delete [] toCh_; } } }