summaryrefslogtreecommitdiff
path: root/product.c
blob: 6c3083422c2e73e2c29adfcc788beeaff10f22eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdlib.h>
#include "request.h"
#include "icclient/product.h"

typedef struct icclient_catalog icclient_catalog;

void icclient_product_freecatalog(icclient_catalog *catalog)
{
	for (size_t i = 0; i < catalog->length; i++) {
		struct icclient_product *product = catalog->products[i];
		if (product->image)
			free(product->image);
		if (product->comment)
			free(product->comment);
		if (product->description)
			free(product->description);
		free(product->sku);
		free(product);
	}
	free(catalog);
	catalog = NULL;
}