Fix crash accessing freed memory

That one should have been quite obvious.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-07-07 15:48:27 -07:00
parent 4fc4bbd9bc
commit fe8605ed5b

View file

@ -209,7 +209,7 @@ static void parse_dive_location(char *line, struct membuffer *str, void *_dive)
} else {
// we already had a dive site linked to the dive
if (same_string(ds->name, "")) {
ds->name = name;
ds->name = strdup(name);
} else {
// and that dive site had a name. that's weird - if our name is different, add it to the notes
if (!same_string(ds->name, name))