diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-14 23:30:31 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-15 20:59:55 -0400 |
commit | 08827cc5f6063a2e3720b9d821c9146fac74a0bd (patch) | |
tree | 0dd48fb3dea7dbb2b555f2c5b0ab8856291a52df /core/divesite.h | |
parent | a2028cd6ef4a52a18ec12d85c59b907f59715ce2 (diff) | |
download | subsurface-08827cc5f6063a2e3720b9d821c9146fac74a0bd.tar.gz |
Parser: fix leakage of dive-site and dive data
Dive site data was collected in "cur_dive_site", which was then
merged into an existing or a new dive site. But only the struct
dive_site pointed to by "cur_dive_site" and the taxonomy data
were freed, not the textual data such as name or description.
Therefore, split out the approrpriate free-ing from the
delete_dive_site() function and call that instead of a simple
free().
A similar situation occured for dives that would not be added
to the dive-table because they were deemed incomplete. Use
free_dive() here instead of a simple free() too.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divesite.h')
-rw-r--r-- | core/divesite.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/divesite.h b/core/divesite.h index b38ef5c28..f5fe1dbd5 100644 --- a/core/divesite.h +++ b/core/divesite.h @@ -56,6 +56,7 @@ void dive_site_table_sort(); struct dive_site *alloc_or_get_dive_site(uint32_t uuid); int nr_of_dives_at_dive_site(uint32_t uuid, bool select_only); bool is_dive_site_used(uint32_t uuid, bool select_only); +void free_dive_site(struct dive_site *ds); void delete_dive_site(uint32_t id); uint32_t create_dive_site(const char *name, timestamp_t divetime); uint32_t create_dive_site_from_current_dive(const char *name); |