From a3b91bf175b9d51fdd3674112e60a773f13c8ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Sat, 20 Jun 2020 11:24:12 +0800 Subject: Move product freeing implementation to product's own implementation --- product.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 product.c (limited to 'product.c') diff --git a/product.c b/product.c new file mode 100644 index 0000000..6fb70b6 --- /dev/null +++ b/product.c @@ -0,0 +1,21 @@ +#include +#include "icclient/product.h" + +void icclient_product_free(struct icclient_product *product) +{ + if (product->author) + free(product->author); + if (product->prodgroup) + free(product->prodgroup); + if (product->image) + free(product->image); + if (product->thumb) + free(product->thumb); + if (product->comment) + free(product->comment); + if (product->description) + free(product->description); + free(product->sku); + free(product); + product = NULL; +} -- cgit v1.2.3