leveldb icon indicating copy to clipboard operation
leveldb copied to clipboard

The memory is used after released ??

Open QiAnXinCodeSafe opened this issue 1 year ago • 1 comments

Hi all, This is Qianxin CodeSafe Team, we found a suspicious issue, at https://github.com/google/leveldb/blob/23e35d792b9154f922b8b575b12596a4d8664c65/util/cache.cc#L316 Element "e" is used at https://github.com/google/leveldb/blob/23e35d792b9154f922b8b575b12596a4d8664c65/util/cache.cc#L314 however,function “Unref” is defined at https://github.com/google/leveldb/blob/23e35d792b9154f922b8b575b12596a4d8664c65/util/cache.cc#L226 where has freed e's memory

QiAnXinCodeSafe avatar Oct 21 '24 08:10 QiAnXinCodeSafe

e is not de-referenced, so any freed memory is not used. The return usage signals that the if condition was entered during FinishErase.

somehibs avatar Jun 06 '25 17:06 somehibs