Browse Source

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 <jjelen@redhat.com>
gniibe/crypto-refresh
Jakub Jelen 9 months ago committed by NIIBE Yutaka
parent
commit
940af3f052
  1. 6
      dirmngr/ldap-misc.c

6
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);

Loading…
Cancel
Save