liquid_feedback_core
changeset 354:c23bb5ebcdec
Free memory for candidate and ballot structure in "lf_update_suggestion_order"
author | jbe |
---|---|
date | Sat Mar 16 18:23:06 2013 +0100 (2013-03-16) |
parents | 31ce1877320b |
children | accffcefeff7 |
files | lf_update_suggestion_order.c |
line diff
1.1 --- a/lf_update_suggestion_order.c Sat Mar 16 18:19:15 2013 +0100 1.2 +++ b/lf_update_suggestion_order.c Sat Mar 16 18:23:06 2013 +0100 1.3 @@ -174,6 +174,16 @@ 1.4 } 1.5 old_member_id = member_id; 1.6 } 1.7 + free(candidates); 1.8 + for (i=0; i<ballot_count; i++) { 1.9 + int j; 1.10 + for (j=0; j<4; j++) { 1.11 + if (ballots[i].sections[j].count) { 1.12 + free(ballots[i].sections[j].candidates); 1.13 + } 1.14 + } 1.15 + } 1.16 + free(ballots); 1.17 } 1.18 1.19 int main(int argc, char **argv) {