* c/ldap.c (scsh_ldap_first_attribute):
(scsh_ldap_next_attribute): free memory for return values
This commit is contained in:
parent
c015769f74
commit
9cbc88c8c6
13
c/ldap.c
13
c/ldap.c
|
@ -323,9 +323,12 @@ s48_value scsh_ldap_first_attribute(s48_value ldap, s48_value entry)
|
|||
&ber);
|
||||
if (name == NULL)
|
||||
res_list = s48_list_2(S48_FALSE, S48_FALSE);
|
||||
else
|
||||
else {
|
||||
res_list = s48_list_2(s48_enter_string(name),
|
||||
scsh_enter_berelement(ber));
|
||||
ldap_memfree(name);
|
||||
}
|
||||
|
||||
S48_GC_UNPROTECT();
|
||||
return res_list;
|
||||
}
|
||||
|
@ -340,7 +343,13 @@ s48_value scsh_ldap_next_attribute(s48_value ldap, s48_value entry, s48_value be
|
|||
name = ldap_next_attribute(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(entry),
|
||||
scsh_extract_berelement(ber));
|
||||
res = (name != NULL) ? s48_enter_string(name) : S48_FALSE;
|
||||
if (name == NULL)
|
||||
res = S48_FALSE;
|
||||
else {
|
||||
res = s48_enter_string(name);
|
||||
ldap_memfree(name);
|
||||
}
|
||||
|
||||
S48_GC_UNPROTECT();
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue