Dive site rewrite: try to fix a crash

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-06-26 15:03:34 -03:00 committed by Dirk Hohndel
parent 2fec1a88de
commit 05c5bf0919
5 changed files with 41 additions and 8 deletions

View file

@ -169,3 +169,13 @@ void copy_dive_site(struct dive_site *orig, struct dive_site *copy)
copy->notes = copy_string(orig->notes);
copy->description = copy_string(orig->description);
}
void clear_dive_site(struct dive_site *ds)
{
free(ds->name);
free(ds->notes);
free(ds->description);
ds->latitude.udeg = 0;
ds->longitude.udeg = 0;
ds->uuid = 0;
}