summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2021-05-20 10:13:51 +0200
committerWerner Koch <wk@gnupg.org>2021-05-20 13:38:07 +0200
commita95ddffdcd58383cce93677be5e7e11c5c229a98 (patch)
tree3705ec520ecc77efa85f07a85c66b47e9b162dca /common
parentdirmngr: For KS_SEARCH return the fingerprint also with LDAP. (diff)
downloadgnupg2-a95ddffdcd58383cce93677be5e7e11c5c229a98.tar.xz
gnupg2-a95ddffdcd58383cce93677be5e7e11c5c229a98.zip
agent: Avoid memory leaks in error code paths.
* agent/command.c (cmd_genkey): Use goto instead of return. * agent/cvt-openpgp.c (convert_from_openpgp_main): Ditto. * agent/genkey.c (agent_ask_new_passphrase): Fix typo to free correct pointer (agent_genkey): Release memory * agent/gpg-agent.c (check_own_socket): Free sockname * agent/protect-tool.c (read_key): Free buf. (agent_askpin): Free passphrase -- Signed-off-by: Jakub Jelen <jjelen@redhat.com> Changed original patch to not add a free before a GPG_ERR_BUG. Signed-off-by: Werner Koch <wk@gnupg.org> GnuPG-bug-id: 5393
Diffstat (limited to 'common')
-rw-r--r--common/tlv-builder.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/tlv-builder.c b/common/tlv-builder.c
index 3b644ca24..59e2691e0 100644
--- a/common/tlv-builder.c
+++ b/common/tlv-builder.c
@@ -350,6 +350,7 @@ get_tlv_length (int class, int tag, int constructed, size_t length)
(void)constructed; /* Not used, but passed for uniformity of such calls. */
+ /* coverity[identical_branches] */
if (tag < 0x1f)
{
buflen++;