aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-11-09 19:53:31 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2023-11-09 19:53:31 +0100
commit5d9740f69ec9faeb93e8545dc84855bbaeaeecf3 (patch)
tree70085465dc76e2f5a2589b99796109d12aea73c2
parent79c0d4adf09ac76302035e178d86c83dbe27097a (diff)
downloadexchange-5d9740f69ec9faeb93e8545dc84855bbaeaeecf3.tar.xz
[pq] free signatures in arrays of blinded denomination signatures
-rw-r--r--src/pq/pq_result_helper.c25
1 files 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;