Cleanup: Fix memory leak in plannernotes.c

dive->notes was overwritten without free()ing the old buffer.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-04-10 14:29:54 +02:00 committed by Lubomir I. Ivanov
parent a4834e198d
commit 71d1e78db2

View file

@ -574,5 +574,6 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
put_string(&buf, "</div>");
finished:
mb_cstring(&buf);
free(dive->notes);
dive->notes = detach_buffer(&buf);
}