summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2017-01-01 09:15:09 -0500
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-01-09 07:36:21 +0100
commitaffb3d659681af1dca04448e25f27c7e22eda0c7 (patch)
tree64c4c16ed73e26581a61ed40bd4688c3d647333b /lib
parent9ca2dccfb51c487b6dc14c64b73a1668d0801086 (diff)
downloadgnutls-affb3d659681af1dca04448e25f27c7e22eda0c7.tar.gz
Corrected a leak in OpenPGP sub-packet parsing.
Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/opencdk/read-packet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/opencdk/read-packet.c b/lib/opencdk/read-packet.c
index f1d165053b..8cba25c471 100644
--- a/lib/opencdk/read-packet.c
+++ b/lib/opencdk/read-packet.c
@@ -596,8 +596,10 @@ read_subpkt(cdk_stream_t inp, cdk_subpkt_t * r_ctx, size_t * r_nbytes)
node->size--;
rc = stream_read(inp, node->d, node->size, &nread);
n += nread;
- if (rc)
+ if (rc) {
+ cdk_subpkt_free(node);
return rc;
+ }
*r_nbytes = n;
if (!*r_ctx)
*r_ctx = node;