From 1ece51ed11cd49ff7190c98f3a94623a6a6c614c 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: Tue, 20 Sep 2022 08:37:11 +0800 Subject: Free unused & nullify what's checked later --- shopify.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shopify.c b/shopify.c index f714c8e..3e8e7c6 100644 --- a/shopify.c +++ b/shopify.c @@ -231,6 +231,7 @@ static enum MHD_Result handle_request(void *cls, struct MHD_Connection *con, } } else { free(params); + params = NULL; char *referer = NULL; MHD_get_connection_values(con, MHD_HEADER_KIND, iterate, (char **[]){ &session_token, &referer }); @@ -303,6 +304,8 @@ static enum MHD_Result handle_request(void *cls, struct MHD_Connection *con, free(access_token); ret = redirect(dec_host, app_id, con, &res); } else if (session_token) { + free(session_token); + free(shop); int i = 0; const struct shopify_api *api; while ((api = &(container->apis[i++]))) -- cgit v1.2.3