From c4c7913d5c48958732f645c8a3edb57c9004dd30 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 21 May 2022 16:36:36 -0700 Subject: web: add support for custom matches --- match.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'match.c') 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); } -- cgit v1.2.3-70-g09d2