--- servers/slapd/overlays/pcache.c 2007/08/28 09:21:34 1.41.2.20 +++ servers/slapd/overlays/pcache.c 2007/10/02 16:24:09 1.41.2.21 @@ -1,4 +1,4 @@ -/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/pcache.c,v 1.41.2.19 2007/07/23 20:08:32 hallvard Exp $ */ +/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/pcache.c,v 1.41.2.20 2007/08/28 09:21:34 ralf Exp $ */ /* This work is part of OpenLDAP Software . * * Copyright 2003-2007 The OpenLDAP Foundation. @@ -1134,8 +1134,8 @@ add_filter_attrs( count++; } - *new_attrs = (AttributeName*)ch_malloc((count+1)* - sizeof(AttributeName)); + *new_attrs = (AttributeName*)ch_calloc( count + 1, + sizeof(AttributeName) ); for (i=0; icount; i++) { (*new_attrs)[i].an_name = attrs->attrs[i].an_name; (*new_attrs)[i].an_desc = attrs->attrs[i].an_desc; @@ -1155,18 +1155,13 @@ add_filter_attrs( continue; (*new_attrs)[j].an_name = filter_attrs[i].an_name; (*new_attrs)[j].an_desc = filter_attrs[i].an_desc; - (*new_attrs)[j].an_oc = NULL; - (*new_attrs)[j].an_oc_exclude = 0; j++; } if ( addoc ) { (*new_attrs)[j].an_name = slap_schema.si_ad_objectClass->ad_cname; (*new_attrs)[j].an_desc = slap_schema.si_ad_objectClass; - (*new_attrs)[j].an_oc = NULL; - (*new_attrs)[j].an_oc_exclude = 0; j++; } - BER_BVZERO( &(*new_attrs)[j].an_name ); } /* NOTE: this is a quick workaround to let pcache minimally interact