From 823b81363a1145de4b8660153007b11faf4e2c56 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Thu, 2 Jun 2022 02:43:58 -0700 Subject: web: fix minor mem leaks and bugs --- web/web_control.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web/web_control.c') diff --git a/web/web_control.c b/web/web_control.c index 07d52b1..7fdec9a 100644 --- a/web/web_control.c +++ b/web/web_control.c @@ -52,8 +52,10 @@ void end_boat_visit(int rem, double avg, int match_id) EMSCRIPTEN_KEEPALIVE void draw_boat_throwing(int pts, char *str, double x, double y, int match_id) { - if (!state || match_id != state->id) + if (!state || match_id != state->id) { + free(str); return; + } char pts_str[10]; sprintf(pts_str, "%d", pts); -- cgit v1.2.3-70-g09d2