diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-10-24 13:27:54 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-10-24 13:27:54 +0800 |
commit | d25508e3a148d2309b8137fa317b6cf87150b0bd (patch) | |
tree | 2238e3c02dc01b4e48bde23b0292a98ef56d14d4 /client.c | |
parent | 0bef9b7717ecff9544284f5ba4b7576dadad4892 (diff) |
Initialise key_product
otherwise other members might be freed because they might not necessary be NULLs.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -64,6 +64,9 @@ void icclient_order(icclient_ord_order **orderptr, const char *sku icclient_product *key_product = malloc(sizeof(icclient_product)); key_product->sku = malloc(strlen(sku) + 1); strcpy(key_product->sku, sku); + key_product->description = NULL; + key_product->comment = NULL; + key_product->image = NULL; icclient_product *product = *(icclient_product **)bsearch(&key_product , products, catalog->length, sizeof(icclient_product *) , prodcmp); |