From 5d9740f69ec9faeb93e8545dc84855bbaeaeecf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Thu, 9 Nov 2023 19:53:31 +0100 Subject: [pq] free signatures in arrays of blinded denomination signatures --- src/pq/pq_result_helper.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c index 6f4338666..9acf80716 100644 --- a/src/pq/pq_result_helper.c +++ b/src/pq/pq_result_helper.c @@ -1141,13 +1141,13 @@ extract_array_generic ( *((void **) dst) = NULL; #define FAIL_IF(cond) \ - do { \ - if ((cond)) \ - { \ - GNUNET_break (! (cond)); \ - goto FAIL; \ - } \ - } while (0) + do { \ + if ((cond)) \ + { \ + GNUNET_break (! (cond)); \ + goto FAIL; \ + } \ + } while (0) col_num = PQfnumber (result, fname); FAIL_IF (0 > col_num); @@ -1365,12 +1365,19 @@ array_cleanup (void *cls, struct ArrayResultCls *info = cls; void **dst = rd; - /* FIXME-Oec: this does not properly clean up - denomination signatures! */ if ((0 == info->same_size) && (NULL != info->sizes)) GNUNET_free (*(info->sizes)); + /* Clean up signatures, if applicable */ + if (TALER_PQ_array_of_blinded_denom_sig == info->typ) + { + struct TALER_BlindedDenominationSignature *denom_sigs = *dst; + GNUNET_assert (NULL != info->num); + for (size_t i = 0; i < *info->num; i++) + GNUNET_free (denom_sigs[i].blinded_sig); + } + GNUNET_free (cls); GNUNET_free (*dst); *dst = NULL; -- cgit v1.2.3