From 19071e628c45c63a6c12d9dd67c76671770e3889 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: Mon, 13 Mar 2023 07:47:38 +0800 Subject: Rename free_product to clear_product --- interchange.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'interchange.c') 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); } -- cgit v1.2.3