From 4e391d95e0711646af649167c7de018cb6367097 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 8 Mar 2023 11:33:18 +0900 Subject: [PATCH] scd: Fix checking memory allocation. * scd/app-openpgp.c (read_public_key): Fix the memory. -- Signed-off-by: NIIBE Yutaka --- scd/app-openpgp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);