From edb67a4f6fe19f6ccc7d89c447503257e89b1e64 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Thu, 24 Mar 2022 23:30:35 +0100 Subject: [PATCH] Fix `getMany()` memory leak 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_; } } }