gpg: Fix memory leak in the error case of signature creation.
authorWerner Koch <wk@gnupg.org>
Fri, 10 Feb 2017 16:16:07 +0000 (17:16 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 10 Feb 2017 16:58:26 +0000 (17:58 +0100)
commit5996c7bf99f3a681393fd9589276399ebc956cff
tree57a04b9d2eb7745e8d49c3e0597cd79c10e4ea31
parent8810314e377a9cb6612150a57cf99260ed0bb9f6
gpg: Fix memory leak in the error case of signature creation.

* g10/sign.c (write_signature_packets): Free SIG.  Also replace
xcalloc by xtrycalloc.
--

If do_sign fails SIG was not released.  Note that in the good case SIG
is transferred to PKT and freed by free_packet.

Reported-by: Stephan Müller
Signed-off-by: Werner Koch <wk@gnupg.org>
g10/sign.c