primegen: Fix memory leak for invalid call sequences.
authorWerner Koch <wk@gnupg.org>
Mon, 5 Jan 2015 17:58:39 +0000 (18:58 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 5 Jan 2015 17:58:39 +0000 (18:58 +0100)
commit8c5eee51d9a25b143e41ffb7ff4a6b2a29b82d83
tree8ebca707d33452f3ff58084729e30f033294ddaf
parentdd5df198727ea5d8f6b04288e14fd732051453c8
primegen: Fix memory leak for invalid call sequences.

* cipher/primegen.c (prime_generate_internal): Refactor generator code
to not leak memory for non-implemented feature.
(_gcry_prime_group_generator): Refactor to not leak memory for invalid
args.  Also make sure that R_G is set as soon as possible.
--

GnuPG-bug-id: 1705
Signed-off-by: Werner Koch <wk@gnupg.org>
cipher/primegen.c