From f45b56aca72cdb288abd7afe95ee696976901b92 Mon Sep 17 00:00:00 2001 From: ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ Date: Sun, 12 Feb 2023 17:24:05 +0800 Subject: Freeing order doesn't include product freeing An item in an order only keeps a pointer to a product it doesn't own. The catalog owns that product, so freeing the catalog is the only one that should include freeing the product. --- ord.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ord.c b/ord.c index 83b8012..8d4e0ae 100644 --- a/ord.c +++ b/ord.c @@ -85,8 +85,6 @@ void interchange_ord_checkout(const struct interchange_ord_order *order, void interchange_ord_free_order(struct interchange_ord_order *order) { - for (size_t i = 0; i < order->nitems; i++) - interchange_free_product(order->items[i]->product); if (order->profile) free(order->profile); free(order); -- cgit v1.3