summaryrefslogtreecommitdiff
path: root/interchange.c
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-13 07:47:38 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-13 07:47:38 +0800
commit19071e628c45c63a6c12d9dd67c76671770e3889 (patch)
tree2a6064d0bcb994d39986fc3e1a1b591bf72b4914 /interchange.c
parentcad4bca73f494b8900f78961907d7f7cdc2265b1 (diff)
Rename free_product to clear_product
Diffstat (limited to 'interchange.c')
-rw-r--r--interchange.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/interchange.c b/interchange.c
index b173614..2e50fba 100644
--- a/interchange.c
+++ b/interchange.c
@@ -67,13 +67,15 @@ void interchange_page(const char *path, void (*handler)(interchange_response *))
request(handler, NULL, NULL, "%s", path);
}
-void interchange_free_product(struct interchange_product *product)
+void interchange_clear_product(struct interchange_product *product)
{
if (product->crosssell)
for (size_t i = 0; i < product->crosssell->length; i++)
free(product->crosssell->skus[i]);
if (product->author)
free(product->author);
+ if (product->category)
+ free(product->category);
if (product->prod_group)
free(product->prod_group);
if (product->image)
@@ -82,17 +84,17 @@ void interchange_free_product(struct interchange_product *product)
free(product->thumb);
if (product->comment)
free(product->comment);
- if (product->description)
- free(product->description);
if (product->title)
free(product->title);
+ if (product->description)
+ free(product->description);
free(product->sku);
}
void interchange_free_catalog(struct interchange_catalog *catalog)
{
for (size_t i = 0; i < catalog->length; i++)
- interchange_free_product(&catalog->products[i]);
+ interchange_clear_product(&catalog->products[i]);
free(catalog);
}