aboutsummaryrefslogtreecommitdiff
path: root/brandt.c
diff options
context:
space:
mode:
Diffstat (limited to 'brandt.c')
-rw-r--r--brandt.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/brandt.c b/brandt.c
index a05731d..ce41541 100644
--- a/brandt.c
+++ b/brandt.c
@@ -68,7 +68,7 @@ BRANDT_bidder_start (struct BRANDT_Auction *auction,
outcome = auction->outcome_public ? outcome_public : outcome_private;
if (auction_mPlusFirstPrice == atype && n <= auction->m)
- { /* fewer bidders than items to sell. every bidder won with lowest price */
+ { /* fewer bidders than items to sell. every bidder won with lowest price */
struct BRANDT_Result *res;
if (auction->outcome_public)
{
@@ -138,7 +138,8 @@ seller_start (void *arg)
}
else if (ad->n <= ad->m)
{
- struct BRANDT_Result *res = GNUNET_new_array (ad->n, struct BRANDT_Result);
+ struct BRANDT_Result *res = GNUNET_new_array (ad->n,
+ struct BRANDT_Result);
weprintf ("less bidders than needed, selling for lowest price");
for (uint16_t i = 0; i < ad->n; i++)
@@ -346,14 +347,23 @@ BRANDT_destroy (struct BRANDT_Auction *auction)
smc_free2 (auction->alpha, auction->n, auction->k);
smc_free2 (auction->beta, auction->n, auction->k);
smc_free2 (auction->gamma2, auction->n, auction->k);
- smc_free3 (auction->gamma3, auction->n, auction->n, auction->k);
smc_free2 (auction->delta2, auction->n, auction->k);
- smc_free3 (auction->delta3, auction->n, auction->n, auction->k);
smc_free2 (auction->phi2, auction->n, auction->k);
- smc_free3 (auction->phi3, auction->n, auction->n, auction->k);
free (auction->phiproofs3);
smc_free1 (auction->tmpa1, auction->k);
smc_free1 (auction->tmpb1, auction->k);
+ if (auction->m > 0 && auction->outcome_public)
+ {
+ smc_free3 (auction->gamma3, auction->n, 2, auction->k);
+ smc_free3 (auction->delta3, auction->n, 2, auction->k);
+ smc_free3 (auction->phi3, auction->n, 2, auction->k);
+ }
+ else
+ {
+ smc_free3 (auction->gamma3, auction->n, auction->n, auction->k);
+ smc_free3 (auction->delta3, auction->n, auction->n, auction->k);
+ smc_free3 (auction->phi3, auction->n, auction->n, auction->k);
+ }
}