From: Howard Chu Date: Wed, 26 Dec 2001 08:49:27 +0000 (+0000) Subject: Fix attrs handling X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~510 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e78a0930c8c56f24fa3d75464a23e6a6580c94d0;p=openldap Fix attrs handling --- 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);