diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-01-24 18:59:42 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-01-24 18:59:42 +0100 |
commit | ee77c6ff211e961fdedb7a6a44ee0fd0a9a5a042 (patch) | |
tree | 1c2b14bcca526ec79f4dd3b9da0f5ed90a847e75 /src/backend/taler-merchant-httpd_private-post-orders.c | |
parent | d004d4a89e0f6799d08d6a6b33c558b5a9eb480e (diff) | |
download | merchant-ee77c6ff211e961fdedb7a6a44ee0fd0a9a5a042.tar.gz merchant-ee77c6ff211e961fdedb7a6a44ee0fd0a9a5a042.tar.bz2 merchant-ee77c6ff211e961fdedb7a6a44ee0fd0a9a5a042.zip |
fix #8209
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-orders.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-orders.c | 53 |
1 files changed, 39 insertions, 14 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c index 74ba7fb7..5986a521 100644 --- a/src/backend/taler-merchant-httpd_private-post-orders.c +++ b/src/backend/taler-merchant-httpd_private-post-orders.c @@ -602,6 +602,31 @@ clean_order (void *cls) json_decref (oc->set_exchanges.exchanges); oc->set_exchanges.exchanges = NULL; } + if (NULL != oc->parse_order.merchant) + { + json_decref (oc->parse_order.merchant); + oc->parse_order.merchant = NULL; + } + if (NULL != oc->parse_order.fulfillment_message_i18n) + { + json_decref (oc->parse_order.fulfillment_message_i18n); + oc->parse_order.fulfillment_message_i18n = NULL; + } + if (NULL != oc->parse_order.summary_i18n) + { + json_decref (oc->parse_order.summary_i18n); + oc->parse_order.summary_i18n = NULL; + } + if (NULL != oc->parse_order.delivery_location) + { + json_decref (oc->parse_order.delivery_location); + oc->parse_order.delivery_location = NULL; + } + if (NULL != oc->merge_inventory.products) + { + json_decref (oc->merge_inventory.products); + oc->merge_inventory.products = NULL; + } GNUNET_array_grow (oc->parse_request.inventory_products, oc->parse_request.inventory_products_length, 0); @@ -1113,8 +1138,8 @@ get_acceptable (void *cls, TMH_EXCHANGES_get_master_pub (exchange))); GNUNET_assert (NULL != j_exchange); GNUNET_assert (0 == - json_array_append (oc->set_exchanges.exchanges, - j_exchange)); + json_array_append_new (oc->set_exchanges.exchanges, + j_exchange)); } @@ -1239,8 +1264,8 @@ serialize_order (struct OrderContext *oc) GNUNET_JSON_pack_string ("summary", oc->parse_order.summary), GNUNET_JSON_pack_allow_null ( - GNUNET_JSON_pack_object_steal ("summary_i18n", - oc->parse_order.summary_i18n)), + GNUNET_JSON_pack_object_incref ("summary_i18n", + oc->parse_order.summary_i18n)), GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_string ("public_reorder_url", oc->parse_order.public_reorder_url)), @@ -1248,13 +1273,13 @@ serialize_order (struct OrderContext *oc) GNUNET_JSON_pack_string ("fulfillment_message", oc->parse_order.fulfillment_message)), GNUNET_JSON_pack_allow_null ( - GNUNET_JSON_pack_object_steal ("fulfillment_message_i18n", - oc->parse_order.fulfillment_message_i18n)), + GNUNET_JSON_pack_object_incref ("fulfillment_message_i18n", + oc->parse_order.fulfillment_message_i18n)), GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_string ("fulfillment_url", oc->parse_order.fulfillment_url)), - GNUNET_JSON_pack_array_steal ("products", - oc->merge_inventory.products), + GNUNET_JSON_pack_array_incref ("products", + oc->merge_inventory.products), GNUNET_JSON_pack_data_auto ("h_wire", &oc->add_payment_details.wm->h_wire), GNUNET_JSON_pack_string ("wire_method", @@ -1271,16 +1296,16 @@ serialize_order (struct OrderContext *oc) GNUNET_JSON_pack_timestamp ("delivery_date", oc->parse_order.delivery_date)), GNUNET_JSON_pack_allow_null ( - GNUNET_JSON_pack_object_steal ("delivery_location", - oc->parse_order.delivery_location)), + GNUNET_JSON_pack_object_incref ("delivery_location", + oc->parse_order.delivery_location)), GNUNET_JSON_pack_string ("merchant_base_url", oc->parse_order.merchant_base_url), - GNUNET_JSON_pack_object_steal ("merchant", - oc->parse_order.merchant), + GNUNET_JSON_pack_object_incref ("merchant", + oc->parse_order.merchant), GNUNET_JSON_pack_data_auto ("merchant_pub", &oc->hc->instance->merchant_pub), - GNUNET_JSON_pack_array_steal ("exchanges", - oc->set_exchanges.exchanges), + GNUNET_JSON_pack_array_incref ("exchanges", + oc->set_exchanges.exchanges), TALER_JSON_pack_amount ("max_fee", &oc->set_max_fee.max_fee), TALER_JSON_pack_amount ("amount", |