From 955054bf25222be9c3942f695e74c8195627405c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 15 May 2015 14:36:08 +0200 Subject: misc bugfixes --- src/pq/db_pq.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'src/pq/db_pq.c') diff --git a/src/pq/db_pq.c b/src/pq/db_pq.c index 220ce9f9..3b39645a 100644 --- a/src/pq/db_pq.c +++ b/src/pq/db_pq.c @@ -225,25 +225,34 @@ TALER_PQ_cleanup_result (struct TALER_PQ_ResultSpec *rs) switch (rs[i].format) { case TALER_PQ_RF_VARSIZE_BLOB: - if (NULL != rs[i].dst) { - GNUNET_free (rs[i].dst); - rs[i].dst = NULL; - *rs[i].result_size = 0; + void **dst = rs[i].dst; + if (NULL != *dst) + { + GNUNET_free (*dst); + *dst = NULL; + *rs[i].result_size = 0; + } + break; } - break; case TALER_PQ_RF_RSA_PUBLIC_KEY: - if (NULL != rs[i].dst) { - GNUNET_CRYPTO_rsa_public_key_free (rs[i].dst); - rs[i].dst = NULL; + void **dst = rs[i].dst; + if (NULL != *dst) + { + GNUNET_CRYPTO_rsa_public_key_free (*dst); + *dst = NULL; + } + break; } - break; case TALER_PQ_RF_RSA_SIGNATURE: - if (NULL != rs[i].dst) { - GNUNET_CRYPTO_rsa_signature_free (rs[i].dst); - rs[i].dst = NULL; + void **dst = rs[i].dst; + if (NULL != *dst) + { + GNUNET_CRYPTO_rsa_signature_free (*dst); + *dst = NULL; + } } break; default: -- cgit v1.2.3