From 71d1e78db2435c74a3170a9fe0d3e4e0e6c946c2 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 10 Apr 2018 14:29:54 +0200 Subject: Cleanup: Fix memory leak in plannernotes.c dive->notes was overwritten without free()ing the old buffer. Signed-off-by: Berthold Stoeger --- core/plannernotes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/plannernotes.c b/core/plannernotes.c index eb6dc018f..1b28252d3 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -574,5 +574,6 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d put_string(&buf, ""); finished: mb_cstring(&buf); + free(dive->notes); dive->notes = detach_buffer(&buf); } -- cgit v1.2.3-70-g09d2