From eb41b8b6ad7efbf740db8c717a2e019cb0bb71d3 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 25 Aug 2017 17:59:05 +0300 Subject: [PATCH] Eliminate 'memory leak' code defect in remove_specific * specific.c [LINT2] (GC_remove_specific): Call GC_noop1(entry) to indicate that entry is lost (the memory will be collected during GC). --- specific.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specific.c b/specific.c index 540bb31..f787fa5 100644 --- a/specific.c +++ b/specific.c @@ -105,6 +105,9 @@ GC_INNER void GC_remove_specific(tsd * key) /* cache lookup, which should still be examining deallocated memory.*/ /* This can only happen if the concurrent access is from another */ /* thread, and hence has missed the cache, but still... */ +# ifdef LINT2 + GC_noop1((word)entry); +# endif /* With GC, we're done, since the pointers from the cache will */ /* be overwritten, all local pointers to the entries will be */ -- 2.7.4