aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ08nY2017-04-07 22:47:04 +0200
committerJ08nY2017-04-07 22:47:04 +0200
commit59f073938cbb75aaeb62062580172464fa274cac (patch)
treea5cfbcc5bc0122d157f076c67ed3d05fe6f4baf3
parent1353d128efa03eda66377f44f76c5a54bd859908 (diff)
downloadecgen-59f073938cbb75aaeb62062580172464fa274cac.tar.gz
ecgen-59f073938cbb75aaeb62062580172464fa274cac.tar.zst
ecgen-59f073938cbb75aaeb62062580172464fa274cac.zip
-rw-r--r--src/exhaustive/exhaustive.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/exhaustive/exhaustive.c b/src/exhaustive/exhaustive.c
index 7884ca0..7b3806e 100644
--- a/src/exhaustive/exhaustive.c
+++ b/src/exhaustive/exhaustive.c
@@ -3,6 +3,7 @@
* Copyright (C) 2017 J08nY
*/
#include "exhaustive.h"
+#include <math/types.h>
#include "io/config.h"
#include "io/output.h"
#include "math/arg.h"
@@ -130,7 +131,11 @@ int exhaustive_gen_retry(curve_t *curve, config_t *cfg, gen_t generators[],
// TODO
} else if (diff <= 0) {
// rewind pari stack
- avma = tops[state + diff - start_offset];
+ int new_state = state + diff - start_offset;
+ if (new_state <= OFFSET_CURVE) {
+ obj_free(curve->curve);
+ }
+ avma = tops[new_state];
}
if (diff == 0) {