gpg: Extend free_packet to handle a packet parser context.
authorWerner Koch <wk@gnupg.org>
Wed, 29 Mar 2017 09:57:40 +0000 (11:57 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 29 Mar 2017 10:08:31 +0000 (12:08 +0200)
commitafa86809087909a8ba2f9356588bf90cc923529c
treeff0941a7831c23a47f9dafa522b375b7cc00daa4
parentba57f8302a3ee12ff117b0243047241c44388179
gpg: Extend free_packet to handle a packet parser context.

* g10/packet.h (struct parse_packet_ctx_s): Add fields LAST_PKT and
FREE_LAST_PKT.
(init_parse_packet): Clear them.
(deinit_parse_packet): New macro.  Change all users if
init_parse_packet to also call this macro.
* g10/free-packet.c (free_packet): Add arg PARSECTX and handle shallow
packet copies in the context.  Change all callers.
* g10/parse-packet.c (parse): Store certain packets in the parse
context.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
12 files changed:
g10/encrypt.c
g10/free-packet.c
g10/import.c
g10/kbnode.c
g10/keydb.c
g10/keyedit.c
g10/keygen.c
g10/keyring.c
g10/mainproc.c
g10/packet.h
g10/parse-packet.c
g10/sign.c