From 1eef01c04168c8d7217c66a981bc5b709785c455 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Thu, 24 Mar 2022 23:26:19 +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 d4cff53..fc5b312 100644 --- a/binding.cc +++ b/binding.cc @@ -285,6 +285,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_; } } }