diff --git a/keygen/primecandidate.c b/keygen/primecandidate.c index 02c0259d..fca2b297 100644 --- a/keygen/primecandidate.c +++ b/keygen/primecandidate.c @@ -396,6 +396,8 @@ mp_int *pcs_generate(PrimeCandidateSource *s) if (!ok) { mp_free(x); + if (s->one_shot) + return NULL; continue; /* try a new x */ }