talons

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

commit 347e003b4ae60cd233102813c53ccca2528cdc58
parent 4b4eded683dee45b097c800bae15f9c11d5d087c
Author: wwp <subscript@free.fr>
Date:   Tue,  5 Oct 2021 12:27:52 +0200

Fix CID 1491230: resource leak.

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

diff --git a/src/ldapctrl.c b/src/ldapctrl.c @@ -575,14 +575,16 @@ 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 ); } else { /* We have something - free up previous result */ retVal = p2; - g_free( p1 ); } + if (p1) + g_free( p1 ); debug_print("current search string: %s\n", retVal); return retVal; }