mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Cleanup: avoid memory leak
Coverity CID 208308 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
169a55d6e8
commit
424e757094
1 changed files with 6 additions and 2 deletions
|
@ -95,19 +95,23 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
|
|||
free((void *)temp);
|
||||
return;
|
||||
} 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>",
|
||||
translate("gettextFromC", "Subsurface"),
|
||||
subsurface_canonical_version(),
|
||||
translate("gettextFromC", "dive plan</b> created on"),
|
||||
get_current_date());
|
||||
current_date);
|
||||
free((void *)current_date);
|
||||
} else {
|
||||
const char *current_date = get_current_date();
|
||||
len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %d:%02d) %s %s<br>",
|
||||
translate("gettextFromC", "Subsurface"),
|
||||
subsurface_canonical_version(),
|
||||
translate("gettextFromC", "dive plan</b> (surface interval "),
|
||||
FRACTION(diveplan->surface_interval / 60, 60),
|
||||
translate("gettextFromC", "created on"),
|
||||
get_current_date());
|
||||
current_date);
|
||||
free((void *)current_date);
|
||||
}
|
||||
|
||||
if (prefs.display_variations && decoMode() != RECREATIONAL)
|
||||
|
|
Loading…
Add table
Reference in a new issue