From 1616421120fc238beda654696541275c9aa0744c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Wed, 2 Feb 2022 23:12:42 +0800 Subject: Response userData is not freed here for Emscripten When the user data is a pointer to the callback function, not a POST body, it must not be freed, otherwise the app will crash/not function. For now freeing it is handed to the user, which in this case, is qrtclient. It's freed when it's a POST body, e.g. when logging in, and no freeing code when GETting data from REST API. --- client.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/client.c b/client.c index 85bc1e7..2ecfc9d 100644 --- a/client.c +++ b/client.c @@ -46,8 +46,6 @@ void rtclient_login(const char *name, const char *password, void rtclient_free_response(rtclient_response *response) { #ifdef __EMSCRIPTEN__ - if (response->userData) - free(response->userData); emscripten_fetch_close(response); #else free(response->data); -- cgit v1.2.3