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>
This commit is contained in:
Berthold Stoeger 2018-10-14 15:46:54 +02:00 committed by Dirk Hohndel
parent 0b57b8d59f
commit 444354ec9b

View file

@ -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;
}