1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-21 10:09:57 +01:00

agent: Avoid memory leak when handling tpm2.

* agent/divert-tpm2.c (agent_write_tpm2_shadow_key): Free memory on
errors.

--

GnuPG-bug-id: 7201
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Jakub Jelen 2024-07-15 20:40:42 +02:00 committed by NIIBE Yutaka
parent 4bdd43fdca
commit be40a33419
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -53,6 +53,7 @@ agent_write_tpm2_shadow_key (ctrl_t ctrl, const unsigned char *grip,
if (err)
{
log_error ("failed to delete unshadowed key: %s\n", gpg_strerror (err));
xfree (shdkey);
return err;
}