summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/filterentry.c
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2008-04-18 20:20:22 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2008-04-18 20:20:22 +0000
commitde38261387552f2a73f05a04a7082d26069750a2 (patch)
treead84e32c332425ea45585620b5ade6434e30b206 /ldap/servers/slapd/filterentry.c
parent34f2b3b90fb8bf38299ad28820b69d4b98518916 (diff)
downloadds-de38261387552f2a73f05a04a7082d26069750a2.tar.gz
ds-de38261387552f2a73f05a04a7082d26069750a2.tar.xz
ds-de38261387552f2a73f05a04a7082d26069750a2.zip
Resolves: #428764
Summary: memory leaks in extensible filter code Description: applying the patch provided by Ulf Weltman 1) type is not consumed in attrlist_merge 2) although dnattrs is a linked list, only the first item was released. Test case filter: "(ou:dn:=groups)"
Diffstat (limited to 'ldap/servers/slapd/filterentry.c')
-rw-r--r--ldap/servers/slapd/filterentry.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ldap/servers/slapd/filterentry.c b/ldap/servers/slapd/filterentry.c
index 317c4f24..1e7ab8bb 100644
--- a/ldap/servers/slapd/filterentry.c
+++ b/ldap/servers/slapd/filterentry.c
@@ -441,6 +441,7 @@ dn2attrs(const char *dn)
bv.bv_len = strlen(val);
bvec[0] = &bv;
attrlist_merge (&dnAttrs, type, bvec);
+ slapi_ch_free_string( &type );
}
}
ldap_value_free (avas);
@@ -505,7 +506,7 @@ test_extensible_filter(
/* B) Also check the DN attributes for the attribute value */
Slapi_Attr* dnattrs= dn2attrs(slapi_entry_get_dn_const(e));
rc= test_ava_filter( callers_pb, e, dnattrs, &a, LDAP_FILTER_EQUALITY, 0 /* Don't Verify Access */ , 0 /* don't just verify access */, access_check_done );
- slapi_attr_free( &dnattrs );
+ attrlist_free( dnattrs );
}
}
else
@@ -520,7 +521,7 @@ test_extensible_filter(
/* D & F) Also check the DN attributes for the attribute value */
Slapi_Attr* dnattrs= dn2attrs(slapi_entry_get_dn_const(e));
mrf->mrf_match (mrf->mrf_object, e, dnattrs);
- slapi_attr_free( &dnattrs );
+ attrlist_free( dnattrs );
}
}
}
@@ -573,7 +574,7 @@ test_extensible_filter(
/* B) Also check the DN attributes for the attribute value */
Slapi_Attr* dnattrs= dn2attrs(slapi_entry_get_dn_const(e));
rc= test_ava_filter( callers_pb, e, dnattrs, &a, LDAP_FILTER_EQUALITY, 0 /* Don't Verify Access */ , 0 /* don't just verify access */, access_check_done );
- slapi_attr_free( &dnattrs );
+ attrlist_free( dnattrs );
}
}
else
@@ -588,7 +589,7 @@ test_extensible_filter(
/* D & F) Also check the DN attributes for the attribute value */
Slapi_Attr* dnattrs= dn2attrs(slapi_entry_get_dn_const(e));
mrf->mrf_match (mrf->mrf_object, e, dnattrs);
- slapi_attr_free( &dnattrs );
+ attrlist_free( dnattrs );
}
}
}