diff options
Diffstat (limited to 'Modules/_lsprof.c')
-rw-r--r-- | Modules/_lsprof.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c index 14bb8f9..8820fcf 100644 --- a/Modules/_lsprof.c +++ b/Modules/_lsprof.c @@ -303,12 +303,17 @@ static void clearEntries(ProfilerObject *pObj) { RotatingTree_Enum(pObj->profilerEntries, freeEntry, NULL); pObj->profilerEntries = EMPTY_ROTATING_TREE; - /* release the memory hold by the free list of ProfilerContexts */ + /* release the memory hold by the ProfilerContexts */ + if (pObj->currentProfilerContext) { + free(pObj->currentProfilerContext); + pObj->currentProfilerContext = NULL; + } while (pObj->freelistProfilerContext) { ProfilerContext *c = pObj->freelistProfilerContext; pObj->freelistProfilerContext = c->previous; free(c); } + pObj->freelistProfilerContext = NULL; } static void |