summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/back-ldbm/vlv.c
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-03-24 17:12:06 +0000
committerRich Megginson <rmeggins@redhat.com>2005-03-24 17:12:06 +0000
commitb6bff935c117b5042cd2a9809218607c01bea965 (patch)
treeff24a822b63d879254a679bad694b09d2454bc67 /ldap/servers/slapd/back-ldbm/vlv.c
parentd80d9cceedbe18c97d240fca0ee6c20d01253423 (diff)
downloadds-b6bff935c117b5042cd2a9809218607c01bea965.tar.gz
ds-b6bff935c117b5042cd2a9809218607c01bea965.tar.xz
ds-b6bff935c117b5042cd2a9809218607c01bea965.zip
Bug(s) fixed: 152030
Bug Description: Various valgrind reported problems. Mostly not serious, but a few which could cause bad leaks in certain situations. Reviewed by: Rob and David (Thanks!) Fix Description: Mostly added frees where needed, or moved things around to make sure the proper free was called. I also fixed the formatting/spacing. Platforms tested: RHEL3 Flag Day: no Doc impact: No. QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
Diffstat (limited to 'ldap/servers/slapd/back-ldbm/vlv.c')
-rw-r--r--ldap/servers/slapd/back-ldbm/vlv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ldap/servers/slapd/back-ldbm/vlv.c b/ldap/servers/slapd/back-ldbm/vlv.c
index ff3aa79a..32719817 100644
--- a/ldap/servers/slapd/back-ldbm/vlv.c
+++ b/ldap/servers/slapd/back-ldbm/vlv.c
@@ -1455,6 +1455,8 @@ vlv_trim_candidates_byvalue(backend *be, const IDList *candidates, const sort_sp
*/
Slapi_Value **csn_value = valueset_get_valuearray(&attr->a_present_values);
struct berval **entry_value = /* xxxPINAKI needs modification attr->a_vals */NULL;
+ PRBool needFree = PR_FALSE;
+
if(sort_control->mr_pb!=NULL)
{
struct berval **tmp_entry_value = NULL;
@@ -1466,6 +1468,7 @@ vlv_trim_candidates_byvalue(backend *be, const IDList *candidates, const sort_sp
else
{
valuearray_get_bervalarray(csn_value,&entry_value);
+ needFree = PR_TRUE; /* entry_value is a copy */
}
if(!sort_control->order)
{
@@ -1475,6 +1478,10 @@ vlv_trim_candidates_byvalue(backend *be, const IDList *candidates, const sort_sp
{
match= sort_attr_compare((struct berval**)typedown_value, entry_value, compare_fn);
}
+ if (needFree) {
+ ber_bvecfree((struct berval**)entry_value);
+ entry_value = NULL;
+ }
}
else
{