summaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2023-03-08 03:33:18 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2023-03-08 03:33:18 +0100
commit4e391d95e0711646af649167c7de018cb6367097 (patch)
tree2435915878c811382bfc821b30a0e99984d1ead1 /scd
parentdoc: Typo fixes and new notes in DETAILS (diff)
downloadgnupg2-4e391d95e0711646af649167c7de018cb6367097.tar.xz
gnupg2-4e391d95e0711646af649167c7de018cb6367097.zip
scd: Fix checking memory allocation.
* scd/app-openpgp.c (read_public_key): Fix the memory. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd')
-rw-r--r--scd/app-openpgp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index e445b2409..f5d0b5111 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -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);