summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/dive.c b/dive.c
index 8d1c71639..fbe7b4a64 100644
--- a/dive.c
+++ b/dive.c
@@ -815,8 +815,13 @@ static void merge_events(struct divecomputer *res, struct divecomputer *src1, st
/* Pick whichever has any info (if either). Prefer 'a' */
static void merge_cylinder_type(cylinder_type_t *res, cylinder_type_t *a, cylinder_type_t *b)
{
- if (a->size.mliter)
+ cylinder_type_t *clean = a;
+ if (a->size.mliter) {
+ clean = b;
b = a;
+ }
+ if (clean->description)
+ free((void *)clean->description);
*res = *b;
}