Projects
openEuler:24.03:SP1:Everything:64G
gnupg2
_service:tar_scm:backport-gpg-Fix-minor-memory-...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-gpg-Fix-minor-memory-leak-during-certain-smartcard-o.patch of Package gnupg2
From 95b9a31f81e4a56518269d2476b54a1f10fe8b3e Mon Sep 17 00:00:00 2001 From: Werner Koch <wk@gnupg.org> Date: Fri, 27 Oct 2023 14:20:47 +0200 Subject: [PATCH] gpg: Fix minor memory leak during certain smartcard operations. * g10/keygen.c (card_store_key_with_backup): Fix memory leak on error. --- g10/keygen.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/g10/keygen.c b/g10/keygen.c index 87940722d..2f8528278 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -5386,17 +5386,26 @@ card_store_key_with_backup (ctrl_t ctrl, PKT_public_key *sub_psk, { ecdh_param_str = ecdh_param_str_from_pk (sk); if (!ecdh_param_str) - return gpg_error_from_syserror (); + { + free_public_key (sk); + return gpg_error_from_syserror (); + } } err = hexkeygrip_from_pk (sk, &hexgrip); if (err) - goto leave; + { + xfree (ecdh_param_str); + free_public_key (sk); + goto leave; + } memset(&info, 0, sizeof (info)); rc = agent_scd_getattr ("SERIALNO", &info); if (rc) { + xfree (ecdh_param_str); + free_public_key (sk); err = (gpg_error_t)rc; goto leave; } -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2