mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-11 22:01:08 +02:00
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>
This commit is contained in:
parent
a9be9f4e6e
commit
940af3f052
@ -298,13 +298,15 @@ ldap_parse_extfilter (const char *string, int silent,
|
|||||||
{
|
{
|
||||||
if (!silent)
|
if (!silent)
|
||||||
log_info ("LDAP filter does not start with a left parentheses\n");
|
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 (string[strlen(string)-1] != ')')
|
||||||
{
|
{
|
||||||
if (!silent)
|
if (!silent)
|
||||||
log_info ("LDAP filter does not end with a right parentheses\n");
|
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);
|
filter = xtrystrdup (string);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user