scd: Fix checking memory allocation.

* scd/app-openpgp.c (read_public_key): Fix the memory.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2023-03-08 11:33:18 +09:00
parent 6bfb4a8d12
commit 4e391d95e0
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054
1 changed files with 1 additions and 1 deletions

View File

@ -1863,7 +1863,7 @@ read_public_key (app_t app, ctrl_t ctrl, u32 created_at, int keyno,
len = gcry_sexp_sprint (s_pkey, GCRYSEXP_FMT_CANON, NULL, 0);
keybuf = xtrymalloc (len);
if (!data)
if (!keybuf)
{
err = gpg_error_from_syserror ();
gcry_sexp_release (s_pkey);