This repository has been archived by the owner on Oct 30, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
clang-tidy
is a static analyzer capable of detecting a wide range of bugs and memory leaks.@mapbox/core-tech is spearheading getting
clang-tidy
working for node c++ modules at mapbox/node-cpp-skel#63.In time we will provide docs for how to enable on
clang-tidy
on travis forcarmen-cache
.Currently I ran
clang-tidy
locally to assess the codebase here and found two problems worth fixing quickly.The following PR fixes a potential memory leak and incorrect usage of
std::move
. The incorrectstd::move
usage is minor. The memory leak could trigger if a newRocksDBCache
is created in JS using an invalid or empty string, or if the database cannot be opened./cc @GretaCB