talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 17bc6d54f0b984de39badbccb4024bbedcdbfce8
parent 9b84fd8c3d885f9d0b2e8ac90e901d89e0208a0c
Author: wwp <subscript@free.fr>
Date:   Wed,  6 Oct 2021 09:39:11 +0200

Fix CID 1492329: use after free (proper fix for CID 1491230).

Diffstat:
Msrc/ldapctrl.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ldapctrl.c b/src/ldapctrl.c @@ -575,7 +575,6 @@ gchar *ldapctl_format_criteria( LdapControl *ctl, const gchar *searchVal ) { } if( p2 == NULL ) { - g_free( p1 ); /* Nothing processed - format a default attribute */ retVal = g_strdup_printf( "(%s=*)", LDAPCTL_ATTR_EMAIL ); } @@ -583,6 +582,8 @@ gchar *ldapctl_format_criteria( LdapControl *ctl, const gchar *searchVal ) { /* We have something - free up previous result */ retVal = p2; } + if (p1) + g_free( p1 ); debug_print("current search string: %s\n", retVal); return retVal; }