summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-17 21:52:06 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-17 21:52:06 +0800
commit12150c2dff8d226987beb78c8d37f595d90502eb (patch)
tree0bd77083f623d4a0fca8ea08339b1733ae9e7569
parent2419d61c5171479586ba606834dcbfaa138c9bb3 (diff)
Should be the user's responsibility to free it
-rw-r--r--pikul.c4
1 files changed, 1 insertions, 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);