From 862cec2137526e96520755b93900b5211191962c 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 81174d0b..eca2d937 100644 --- a/specific.c +++ b/specific.c @@ -111,6 +111,9 @@ GC_INNER void GC_remove_specific_after_fork(tsd * key, pthread_t t) /* 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.40.0