summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-14 15:46:54 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-14 15:55:07 -0400
commit444354ec9b6b81cb4f76611b61eb09ffea3c8aed (patch)
tree0c1a893774de5d52d88f96bcc9b5c7bbae31dda4
parent0b57b8d59f9e9eeb10f7d66bb4b83f78394f68e7 (diff)
downloadsubsurface-444354ec9b6b81cb4f76611b61eb09ffea3c8aed.tar.gz
Cleanup: free all data in clear_table()
Instead of calling free() on all dives, call free_dive() which also frees additional allocated data, not only the dive struct. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--core/divelist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/divelist.c b/core/divelist.c
index db84f53cf..88a4de152 100644
--- a/core/divelist.c
+++ b/core/divelist.c
@@ -1691,7 +1691,7 @@ void clear_dive_file_data()
void clear_table(struct dive_table *table)
{
for (int i = 0; i < table->nr; i++)
- free(table->dives[i]);
+ free_dive(table->dives[i]);
table->nr = 0;
}