summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-02-02 23:12:42 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-02-02 23:12:42 +0800
commit1616421120fc238beda654696541275c9aa0744c (patch)
treec3a9a6c804a9bdda9c72e9ec7252a8a4605bbeda
parent12cde42c929b63a1ef1b2ad7f3482336419980b2 (diff)
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.
-rw-r--r--client.c2
1 files changed, 0 insertions, 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);