From 12150c2dff8d226987beb78c8d37f595d90502eb 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: Sat, 17 Jul 2021 21:52:06 +0800 Subject: Should be the user's responsibility to free it --- pikul.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pikul.c b/pikul.c index b3e6352..ed11d9c 100644 --- a/pikul.c +++ b/pikul.c @@ -4,7 +4,6 @@ CURL *curl; json_tokener *tokener; struct shipping shipping; -static char *tracking_number = NULL; extern inline void headers(const char *[], char *[]); extern inline void handle(enum type, const char *, size_t, const char *[], const char *[], const char *[], @@ -118,6 +117,7 @@ char *pikul_order(const char *order_number, const char *service, const char *sen const char *destination, const char *receiver_address, const char *receiver_postal, int nitems, char **items[], _Bool insurance, double subtotal) { + char *tracking_number = NULL; curl_easy_setopt(curl, CURLOPT_WRITEDATA, &tracking_number); char *url; char *post = NULL; @@ -151,8 +151,6 @@ void pikul_cleanup() default: break; } - if (tracking_number) - free(tracking_number); free(shipping.base); json_tokener_free(tokener); curl_slist_free_all(shipping.headers); -- cgit v1.2.3