commit abda86e0c6ce660baa568eef722bb14fd7bbfd09
parent 4ab583e275576073a8831d55a8b7c6b4db1e5e3e
Author: Ricardo Mones <ricardo@mones.org>
Date: Fri, 15 Nov 2024 23:46:26 +0100
Fix CID 1491093: attrib leaked if attvalue is null
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ldapquery.c b/src/ldapquery.c
@@ -618,9 +618,9 @@ static GList *ldapqry_process_single_entry(
listDisplay = ldapqry_add_single_value( ld, e, attribute );
} else {
GSList *attlist = ldapqry_add_single_value( ld, e, attribute );
- UserAttribute *attrib = addritem_create_attribute();
const gchar *attvalue = attlist?((gchar *)attlist->data):NULL;
if (attvalue) {
+ UserAttribute *attrib = addritem_create_attribute();
addritem_attrib_set_name( attrib, attribute );
addritem_attrib_set_value( attrib, attvalue );
other_attrs = g_slist_prepend(other_attrs, attrib);