aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-01-05 00:18:47 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2022-01-05 00:18:47 +0100
commit4c4616d989864c09241740e70bffde872c85b547 (patch)
tree2cd1e24fdc6aa9f10421e914925397ab4d6acc86
parent3607c9858ced4fe9050f6f4ebdd668efa6c3e02e (diff)
downloadgnunet-4c4616d989864c09241740e70bffde872c85b547.tar.gz
gnunet-4c4616d989864c09241740e70bffde872c85b547.zip
-actually fix record count
-rw-r--r--src/reclaim/gnunet-service-reclaim_tickets.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/reclaim/gnunet-service-reclaim_tickets.c b/src/reclaim/gnunet-service-reclaim_tickets.c
index 70075bb8e..0dd87aee9 100644
--- a/src/reclaim/gnunet-service-reclaim_tickets.c
+++ b/src/reclaim/gnunet-service-reclaim_tickets.c
@@ -1295,14 +1295,13 @@ issue_ticket (struct TicketIssueHandle *ih)
1295 char *label; 1295 char *label;
1296 int i; 1296 int i;
1297 int j; 1297 int j;
1298 int record_count; 1298 int record_count = 1; /* At least 1 record for the ticket */
1299 1299
1300 for (le = ih->attrs->list_head; NULL != le; le = le->next) 1300 for (le = ih->attrs->list_head; NULL != le; le = le->next)
1301 record_count++; 1301 record_count += 2; /* Worst case we have one presentation per attribute */
1302 1302
1303 // Worst case we have one presentation per attribute
1304 attrs_record = 1303 attrs_record =
1305 GNUNET_malloc (1 + 2 * record_count * sizeof(struct GNUNET_GNSRECORD_Data)); 1304 GNUNET_malloc (record_count * sizeof(struct GNUNET_GNSRECORD_Data));
1306 i = 0; 1305 i = 0;
1307 for (le = ih->attrs->list_head; NULL != le; le = le->next) 1306 for (le = ih->attrs->list_head; NULL != le; le = le->next)
1308 { 1307 {