From 03a76a1805d923ba915073f0eb375156dc7a8e30 Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Sat, 22 Aug 2020 15:40:07 -0500 Subject: [PATCH] REVIEW: Memory Leak - hash::resize() 196,628 bytes in 1 blocks are still reachable --- simgear/nasal/hash.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/simgear/nasal/hash.c b/simgear/nasal/hash.c index 3679a0ca..1bcaead2 100644 --- a/simgear/nasal/hash.c +++ b/simgear/nasal/hash.c @@ -109,6 +109,11 @@ static HashRec* resize(struct naHash* hash) int oldsz = hr->size; while(oldsz) { oldsz >>= 1; lgsz++; } } + + // REVIEW: Memory Leak - 196,628 bytes in 1 blocks are still reachable + // Since method returns a HashRec*, assuming caller is responsible for freeing the memory + // trace: codegen::naInternSymbol() > naHash_set() > size() + // seems to be a known issue - refer to comment @ codegen::naInternSymbol() hr2 = naAlloc(recsize(lgsz)); hr2->size = hr2->next = 0; hr2->lgsz = lgsz;