aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/ldap-misc.c
diff options
context:
space:
mode:
authorJakub Jelen <[email protected]>2021-11-23 08:34:25 +0000
committerNIIBE Yutaka <[email protected]>2021-11-24 01:50:33 +0000
commit940af3f05231dd85138fd3415c7bb7a974bec950 (patch)
tree7e0604e060633c352378c405e95b3ace01ded544 /dirmngr/ldap-misc.c
parentgpg: Fix format_keyid. (diff)
downloadgnupg-940af3f05231dd85138fd3415c7bb7a974bec950.tar.gz
gnupg-940af3f05231dd85138fd3415c7bb7a974bec950.zip
dirmngr: Avoid memory leaks on errors
* dirmngr/ldap-misc.c (ldap_parse_extfilter): Avoid direct return without freeing resources on errors. -- GnuPG-bug-id: 5393 Signed-off-by: Jakub Jelen <[email protected]>
Diffstat (limited to 'dirmngr/ldap-misc.c')
-rw-r--r--dirmngr/ldap-misc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/dirmngr/ldap-misc.c b/dirmngr/ldap-misc.c
index 42f9c7afc..90f1d1f3c 100644
--- a/dirmngr/ldap-misc.c
+++ b/dirmngr/ldap-misc.c
@@ -298,13 +298,15 @@ ldap_parse_extfilter (const char *string, int silent,
{
if (!silent)
log_info ("LDAP filter does not start with a left parentheses\n");
- return gpg_error (GPG_ERR_SYNTAX);
+ err = gpg_error (GPG_ERR_SYNTAX);
+ goto leave;
}
if (string[strlen(string)-1] != ')')
{
if (!silent)
log_info ("LDAP filter does not end with a right parentheses\n");
- return gpg_error (GPG_ERR_SYNTAX);
+ err = gpg_error (GPG_ERR_SYNTAX);
+ goto leave;
}
filter = xtrystrdup (string);