pub/dh-kcdsa.c: Free the correct factor.
[catacomb] / pub / dh-kcdsa.c
index e773309..5feda92 100644 (file)
@@ -88,7 +88,7 @@ int dh_kcdsagen(dh_param *dp, unsigned ql, unsigned pl,
   dp->q = pgen("p", MP_NEW, x, ev, ec,
               steps, pgen_simulstep, &ss,
               rabin_iters(ql), pgen_simultest, &ss);
-  mp_drop(sp[0].mul);
+  mp_drop(sp[1].mul);
   if (!dp->q)
     goto fail_1;
   dp->p = sp[1].u.x;