summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-21 16:36:36 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-21 16:36:36 -0700
commitc4c7913d5c48958732f645c8a3edb57c9004dd30 (patch)
tree9f1a04efa3fa1e95793bd710bfb583b8469ae2c0 /match.c
parente7a2e5e24bf0523fb49a3ce07e3eb96d1fd5aea2 (diff)
downloaddartboat-multi.tar.gz
dartboat-multi.tar.xz
web: add support for custom matchesmulti
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);
}