From e78a0930c8c56f24fa3d75464a23e6a6580c94d0 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 26 Dec 2001 08:49:27 +0000 Subject: [PATCH] Fix attrs handling --- servers/slapd/back-tcl/tcl_search.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/servers/slapd/back-tcl/tcl_search.c b/servers/slapd/back-tcl/tcl_search.c index dad14c8205..3f557d4757 100644 --- a/servers/slapd/back-tcl/tcl_search.c +++ b/servers/slapd/back-tcl/tcl_search.c @@ -36,6 +36,7 @@ tcl_back_search ( char *attrs_tcl = NULL, *suf_tcl, *results, *command; int i, err = 0, code; struct tclinfo *ti = (struct tclinfo *) be->be_private; + char **sattrs = NULL; Entry *e; if (ti->ti_search == NULL) { @@ -44,9 +45,12 @@ tcl_back_search ( return (-1); } - for (i = 0; attrs != NULL && attrs[i] != NULL; i++); - if (i > 0) - attrs_tcl = Tcl_Merge (i, attrs); + for (i = 0; attrs != NULL && attrs[i] != NULL; i++) + charray_add(&sattrs, attrs[i]->bv_val); + if (i > 0) { + attrs_tcl = Tcl_Merge (i, sattrs); + charray_free(sattrs); + } for (i = 0; be->be_suffix[i] != NULL; i++); suf_tcl = Tcl_Merge (i, be->be_suffix); -- 2.39.5