Exit add_plan_to_notes() in plannernotes.c always via label finished

Replace an early "return" in add_plan_to_notes() with a "goto finished;"
This was the initial idea of doing it plus it fixes a potential memory
leak (missing free for icdbuffer).

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2018-02-19 21:28:03 +01:00 committed by Lubomir I. Ivanov
parent 4b2f289e4f
commit f08e24d65b

View file

@ -134,9 +134,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
subsurface_canonical_version(),
translate("gettextFromC", "dive plan</b> (overlapping dives detected)"));
dive->notes = strdup(buffer);
free((void *)buffer);
free((void *)temp);
return;
goto finished;
} else if (diveplan->surface_interval >= 48 * 60 *60) {
const char *current_date = get_current_date();
len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %s</b><br>",