diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-06-02 02:43:58 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-06-02 02:43:58 -0700 |
commit | 823b81363a1145de4b8660153007b11faf4e2c56 (patch) | |
tree | 09d9c70e232c1b98ec8447cae6b6618bcd91497d /web/web_control.c | |
parent | 1db534799ef5b41114d80fce0c38f1c93235a8a3 (diff) | |
download | dartboat-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.c | 4 |
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); |