chiark / gitweb /
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)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 18 Sep 2017 20:41:12 +0000 (21:41 +0100)
commit2afe8583a1d8288bea29c177bf2355d895b6e054
tree101fa9f13ab718251ecbaa8195e8b7738843c39b
parent2a716ddc3d81b48f9dc865d2333441fe5633b267
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>
(cherry picked from commit 5996c7bf99f3a681393fd9589276399ebc956cff)

Gbp-Pq: Name 0034-gpg-Fix-memory-leak-in-the-error-case-of-signature-c.patch
g10/sign.c