From b1f8b6b9505ea51d951202af1bc909704558293f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 17 Apr 2020 21:14:01 +0200 Subject: profile: avoid double-free when reusing plot_info free_plot_info_data() freed the pressure-data, but didn't set the value to NULL. Thus, when the plot_info was reused, a double-free() could ensue. Crash condition: export the profiles of multiple dives with pressure data. Reported-by: Willem Ferguson Signed-off-by: Berthold Stoeger --- core/profile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/profile.c b/core/profile.c index 26488cc30..6914b8301 100644 --- a/core/profile.c +++ b/core/profile.c @@ -499,6 +499,7 @@ void free_plot_info_data(struct plot_info *pi) free(pi->entry); free(pi->pressures); pi->entry = NULL; + pi->pressures = NULL; } static void populate_plot_entries(struct dive *dive, struct divecomputer *dc, struct plot_info *pi) -- cgit v1.2.3-70-g09d2