gpg: Fix actual leak and possible leaks in the packet parser.
authorWerner Koch <wk@gnupg.org>
Thu, 30 Mar 2017 14:01:52 +0000 (16:01 +0200)
committerWerner Koch <wk@gnupg.org>
Thu, 30 Mar 2017 14:01:52 +0000 (16:01 +0200)
commit7bf24e8146116a30c4c9d7b6dbf8bbb27fc35971
treee095f9d4803de715a40cff6f3dcecde1b9dc65bb
parent64665404e43051fa50ee030766347e24b7d1e4d5
gpg: Fix actual leak and possible leaks in the packet parser.

* g10/packet.h (struct parse_packet_ctx_s): Change LAST_PKT deom a
pointer to its struct.
(init_parse_packet): Adjust for LAST_PKT not being a pointer.
* g10/parse-packet.c (parse): Ditto. Free the last packet before
storing a new one in case of a deep link.
(parse_ring_trust): Adjust for LAST_PKT not being a pointer.
* g10/free-packet.c (free_packet): Ditto.
* g10/t-keydb-get-keyblock.c (do_test): Release keyblock.
--

Fixes-commit: afa86809087909a8ba2f9356588bf90cc923529c
Signed-off-by: Werner Koch <wk@gnupg.org>
g10/build-packet.c
g10/free-packet.c
g10/packet.h
g10/parse-packet.c
g10/t-keydb-get-keyblock.c