Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12314
Modified Files: filterentry.c Log Message: 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)"
Index: filterentry.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/filterentry.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- filterentry.c 12 Oct 2007 18:03:42 -0000 1.6 +++ filterentry.c 18 Apr 2008 20:20:22 -0000 1.7 @@ -441,6 +441,7 @@ 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 @@ /* 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 @@ /* 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 @@ /* 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 @@ /* 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 ); } } }
389-commits@lists.fedoraproject.org