1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

cgtest: destroy the global PRNG after every cmdgen_main().

This prevents an assertion failure when random_ref() tries to create
a new PRNG instance and finds there already is one. It also exposes
bugs in which some code path forgot to initialise the PRNG when it
was going to need it, such as the one fixed in the previous commit.
This commit is contained in:
Simon Tatham
2019-03-24 14:08:11 +00:00
parent 692238cc5f
commit d159a6efac
3 changed files with 18 additions and 4 deletions

View File

@ -1160,6 +1160,7 @@ void test(int retval, ...)
printf("\n");
}
ret = cmdgen_main(argc, argv);
random_clear();
if (ret != retval) {
printf("FAILED retval (exp %d got %d):", retval, ret);