summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.c b/main.c
index d66972cdc..3d9b43b41 100644
--- a/main.c
+++ b/main.c
@@ -125,6 +125,9 @@ void report_dives(gboolean is_imported)
if (!merged)
continue;
+ /* careful - we might free the dive that last points to. Oops... */
+ if (last == prev || last == dive)
+ last = merged;
free(prev);
free(dive);
*pp = merged;