summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
Diffstat (limited to 'match.c')
-rw-r--r--match.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/match.c b/match.c
index d8f8a23..1e131f0 100644
--- a/match.c
+++ b/match.c
@@ -6,7 +6,7 @@
struct leg *leg_init(int points, char *name)
{
struct leg *l = calloc(1, sizeof(*l));
- l->name = name;
+ l->name = strdup(name);
l->start = l->rem = points;
l->size_visits = 16;
l->visits = calloc(l->size_visits, sizeof(*(l->visits)));
@@ -23,6 +23,7 @@ void leg_free(struct leg *l)
free(l->visits[i].ccoords);
}
free(l->visits);
+ free(l->name);
free(l);
}