leveldb
leveldb copied to clipboard
Memory Leak?
Hi all,
This is Qianxin CodeSafe Team, we found a memory leak, at
https://github.com/google/leveldb/blob/23e35d792b9154f922b8b575b12596a4d8664c65/db/version_set.cc#L1240
https://github.com/google/leveldb/blob/23e35d792b9154f922b8b575b12596a4d8664c65/db/version_set.cc#L1241
Although the array is deleted at
https://github.com/google/leveldb/blob/23e35d792b9154f922b8b575b12596a4d8664c65/db/version_set.cc#L1248
, the elements in the array are not memory cleaned
- The ownership of objects created by Line 1240
NewTwoLevelIteratorwill be taken byNewMergingIterator
https://github.com/google/leveldb/blob/23e35d792b9154f922b8b575b12596a4d8664c65/db/version_set.cc#L1247-L1249
- The ownership of objects created Liine 1241
new Version::LevelFileNumIterator(...)will be taken by the objects created byNewTwoLevelIterator
So no memory leaks!