From 336e21a5943e770da94553fa9559b891e0155da5 Mon Sep 17 00:00:00 2001 From: Benjamin Poirier Date: Thu, 1 Apr 2010 10:49:39 -0400 Subject: [PATCH] Fix two memory leaks Found using valgrind, of course. Signed-off-by: Benjamin Poirier --- lttv/lttv/sync/event_analysis_chull.c | 6 ++++-- lttv/lttv/sync/event_processing_lttng_common.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lttv/lttv/sync/event_analysis_chull.c b/lttv/lttv/sync/event_analysis_chull.c index 154258e0..21f28893 100644 --- a/lttv/lttv/sync/event_analysis_chull.c +++ b/lttv/lttv/sync/event_analysis_chull.c @@ -384,13 +384,15 @@ static void destroyAnalysisCHull(SyncState* const syncState) for (j= 0; j < i; j++) { - // There seems to be a memory leak in glpk, valgrind reports a - // loss (reachable) even if the problem is deleted glp_delete_prob(analysisData->lps[i][j]); } free(analysisData->lps[i]); } free(analysisData->lps); + + /* Be careful, this invalidates all problem objects which still exist. + * Don't keep copies of lps past this point. */ + glp_free_env(); } #endif diff --git a/lttv/lttv/sync/event_processing_lttng_common.c b/lttv/lttv/sync/event_processing_lttng_common.c index 62044f6f..892d2028 100644 --- a/lttv/lttv/sync/event_processing_lttng_common.c +++ b/lttv/lttv/sync/event_processing_lttng_common.c @@ -240,6 +240,7 @@ void unregisterHooks(GArray* hookListList, LttvTracesetContext* const } } + lttv_trace_hook_remove_all(&hookList); g_array_free(hookList, TRUE); } g_array_free(hookListList, TRUE); -- 2.34.1