summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-24 17:30:30 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-24 17:30:30 +0800
commit6e7d2c8ef7394e31f18b7193fb1957d3242c72aa (patch)
treeae53f904e3048b8ec41c67ed0f1c46929002f65a
parent43bccf79db07e0480b99842615e77183cf2949eb (diff)
parentd63004317fa73c1a9cf25958c42b73d4b16f16b0 (diff)
Merge branch 'master' into sicepat
-rw-r--r--pikul.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pikul.c b/pikul.c
index 18e04a7..ddb02a7 100644
--- a/pikul.c
+++ b/pikul.c
@@ -331,7 +331,8 @@ char *pikul_order(enum pikul_company company, const char *order_number, const ch
void pikul_cleanup()
{
for (enum pikul_company company = PIKUL; company < PIKUL_END; company++) {
- if (!shipping_list[company])
+ struct shipping *shipping = shipping_list[company];
+ if (!shipping)
continue;
switch (company) {
case PIKUL_ANTERAJA:
@@ -340,11 +341,12 @@ void pikul_cleanup()
default:
break;
}
- struct shipping *shipping = shipping_list[company];
free(shipping->base);
json_tokener_free(shipping->tokener);
curl_slist_free_all(shipping->headers);
curl_easy_cleanup(shipping->handle);
+ free(shipping);
+ shipping_list[company] = NULL;
}
curl_global_cleanup();
}