summaryrefslogtreecommitdiff
path: root/web/web_control.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-06-02 02:43:58 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-06-02 02:43:58 -0700
commit823b81363a1145de4b8660153007b11faf4e2c56 (patch)
tree09d9c70e232c1b98ec8447cae6b6618bcd91497d /web/web_control.c
parent1db534799ef5b41114d80fce0c38f1c93235a8a3 (diff)
downloaddartboat-823b81363a1145de4b8660153007b11faf4e2c56.tar.gz
dartboat-823b81363a1145de4b8660153007b11faf4e2c56.tar.xz
web: fix minor mem leaks and bugs
Diffstat (limited to 'web/web_control.c')
-rw-r--r--web/web_control.c4
1 files changed, 3 insertions, 1 deletions
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);