kriszyp / lmdb-js

Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Other
520 stars 44 forks source link

Valgrind warnings #300

Open yamadapc opened 3 months ago

yamadapc commented 3 months ago

Running a few tests under valgrind produces the following warnings:

Conditional jump or move depends on uninitialised value(s)

https://github.com/kriszyp/lmdb-js/blob/89032ed79729c66b175aba1f6ae4366ca9a8f198/src/lmdb-js.h#L354

lastReaderCheck has no initialization ; I reckon what it is initialized with is undefined behaviour.

Mismatched free / delete / delete[]

Warning about free call on: https://github.com/kriszyp/lmdb-js/blob/89032ed79729c66b175aba1f6ae4366ca9a8f198/src/lmdb-js.h#L320

openEnvWraps is a vector allocated with new on https://github.com/kriszyp/lmdb-js/blob/89032ed79729c66b175aba1f6ae4366ca9a8f198/src/env.cpp#L390

free won't call the destructor so I think this is leaking memory as the vector internals won't be released.