summaryrefslogtreecommitdiff
path: root/shopify.c
diff options
context:
space:
mode:
Diffstat (limited to 'shopify.c')
-rw-r--r--shopify.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/shopify.c b/shopify.c
index cd93bff..a8c2613 100644
--- a/shopify.c
+++ b/shopify.c
@@ -44,10 +44,8 @@
json_tokener_free(tokener);\
return MHD_NO;\
}\
- char code[strlen(postalcode) + 1];\
- code[0] = '\0';\
- strcpy(code, postalcode);\
- B = code;\
+ B = malloc(strlen(postalcode) + 1);\
+ strcpy(B, postalcode);\
}
struct parameter {
@@ -550,6 +548,8 @@ static enum MHD_Result handle_request(void *cls, struct MHD_Connection *con,
*upload_data_size = 0;
char *json = carrierservice->rates(origin,
destination, grams, session);
+ free(origin);
+ free(destination);
if (!json)
return MHD_NO;
res = MHD_create_response_from_buffer(