* c/ldap.c (scsh_ldap_first_attribute):

(scsh_ldap_next_attribute): free memory for return values
This commit is contained in:
eknauel 2004-02-13 16:51:23 +00:00
parent c015769f74
commit 9cbc88c8c6
1 changed files with 11 additions and 2 deletions

View File

@ -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;
}