mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <willemferguson@zoology.up.ac.za> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
af753a52e3
commit
b1f8b6b950
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue