From 63b109ca1c1c54319d164ddcfa5760aa66558ccd 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:41:01 +0800 Subject: Move catalog freeing implementation to catalog's own implementation --- catalog.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 catalog.c (limited to 'catalog.c') diff --git a/catalog.c b/catalog.c new file mode 100644 index 0000000..27e2385 --- /dev/null +++ b/catalog.c @@ -0,0 +1,11 @@ +#include +#include "icclient/product.h" +#include "icclient/catalog.h" + +void icclient_catalog_free(struct icclient_catalog *catalog) +{ + for (size_t i = 0; i < catalog->length; i++) + icclient_product_free(catalog->products[i]); + free(catalog); + catalog = NULL; +} -- cgit v1.2.3