From 809c6570e45033435d940960d27c7cbb05afe50b Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Fri, 19 Feb 1999 07:55:20 +0000 Subject: [PATCH] Converted strdup()'s to ch_strdup() --- servers/slapd/back-tcl/Version.c | 6 ++++-- servers/slapd/back-tcl/tcl_abandon.c | 18 +++++++++--------- servers/slapd/back-tcl/tcl_add.c | 6 +++--- servers/slapd/back-tcl/tcl_bind.c | 6 +++--- servers/slapd/back-tcl/tcl_compare.c | 6 +++--- servers/slapd/back-tcl/tcl_config.c | 24 ++++++++++++------------ servers/slapd/back-tcl/tcl_delete.c | 6 +++--- servers/slapd/back-tcl/tcl_modify.c | 6 +++--- servers/slapd/back-tcl/tcl_modrdn.c | 6 +++--- servers/slapd/back-tcl/tcl_search.c | 6 +++--- servers/slapd/back-tcl/tcl_unbind.c | 8 ++++---- servers/slapd/back-tcl/tcl_util.c | 4 ++-- 12 files changed, 52 insertions(+), 50 deletions(-) diff --git a/servers/slapd/back-tcl/Version.c b/servers/slapd/back-tcl/Version.c index ad78076533..c896e54251 100644 --- a/servers/slapd/back-tcl/Version.c +++ b/servers/slapd/back-tcl/Version.c @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: Version.c,v 1.2 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -8,4 +8,6 @@ * in file LICENSE in the top-level directory of the distribution. */ -static char Versionstr[] = " tcl backend %VERSION% (%WHEN%)\n\t%WHOANDWHERE%\n"; +static char Versionstr[] = + +" tcl backend %VERSION% (%WHEN%)\n\t%WHOANDWHERE%\n"; diff --git a/servers/slapd/back-tcl/tcl_abandon.c b/servers/slapd/back-tcl/tcl_abandon.c index dcd07cca81..21ecd3cf8f 100644 --- a/servers/slapd/back-tcl/tcl_abandon.c +++ b/servers/slapd/back-tcl/tcl_abandon.c @@ -1,6 +1,6 @@ /* abandon.c - tcl abandon routine * - * $Id: tcl_abandon.c,v 1.2 1999/02/16 23:32:49 bcollins Exp $ + * $Id: tcl_abandon.c,v 1.3 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -44,16 +44,16 @@ tcl_back_abandon ( ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex); code = Tcl_GlobalEval (ti->ti_ii->interp, command); - results = (char *) strdup (ti->ti_ii->interp->result); + results = (char *) ch_strdup (ti->ti_ii->interp->result); ldap_pvt_thread_mutex_unlock (&tcl_interpreter_mutex); free (command); - if (code != TCL_OK) { - err = LDAP_OPERATIONS_ERROR; - Debug (LDAP_DEBUG_ANY, "tcl_abandon_error: %s\n", results, - 0, 0); - } + if (code != TCL_OK) { + err = LDAP_OPERATIONS_ERROR; + Debug (LDAP_DEBUG_ANY, "tcl_abandon_error: %s\n", results, + 0, 0); + } - free(results); - return (err); + free (results); + return (err); } diff --git a/servers/slapd/back-tcl/tcl_add.c b/servers/slapd/back-tcl/tcl_add.c index 2eb0406674..0abb6dae9c 100644 --- a/servers/slapd/back-tcl/tcl_add.c +++ b/servers/slapd/back-tcl/tcl_add.c @@ -1,6 +1,6 @@ /* add.c - tcl add routine * - * $Id: tcl_add.c,v 1.2 1999/02/17 01:05:28 bcollins Exp $ + * $Id: tcl_add.c,v 1.3 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -50,7 +50,7 @@ tcl_back_add ( ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex); code = Tcl_GlobalEval (ti->ti_ii->interp, command); - results = (char *) strdup (ti->ti_ii->interp->result); + results = (char *) ch_strdup (ti->ti_ii->interp->result); ldap_pvt_thread_mutex_unlock (&tcl_interpreter_mutex); free (command); @@ -65,6 +65,6 @@ tcl_back_add ( send_ldap_result (conn, op, err, NULL, "internal backend error"); - free(results); + free (results); return (err); } diff --git a/servers/slapd/back-tcl/tcl_bind.c b/servers/slapd/back-tcl/tcl_bind.c index 20b4dae301..1a466b2f6f 100644 --- a/servers/slapd/back-tcl/tcl_bind.c +++ b/servers/slapd/back-tcl/tcl_bind.c @@ -1,6 +1,6 @@ /* bind.c - tcl bind routines * - * $Id: tcl_bind.c,v 1.2 1999/02/17 01:05:28 bcollins Exp $ + * $Id: tcl_bind.c,v 1.3 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -53,7 +53,7 @@ tcl_back_bind ( ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex); code = Tcl_GlobalEval (ti->ti_ii->interp, command); - results = (char *) strdup (ti->ti_ii->interp->result); + results = (char *) ch_strdup (ti->ti_ii->interp->result); ldap_pvt_thread_mutex_unlock (&tcl_interpreter_mutex); free (command); @@ -68,6 +68,6 @@ tcl_back_bind ( send_ldap_result (conn, op, err, NULL, "internal backend error"); - free(results); + free (results); return (err); } diff --git a/servers/slapd/back-tcl/tcl_compare.c b/servers/slapd/back-tcl/tcl_compare.c index 1882605e12..3eee8f8607 100644 --- a/servers/slapd/back-tcl/tcl_compare.c +++ b/servers/slapd/back-tcl/tcl_compare.c @@ -1,6 +1,6 @@ /* compare.c - tcl compare routines * - * $Id: tcl_compare.c,v 1.2 1999/02/17 01:05:28 bcollins Exp $ + * $Id: tcl_compare.c,v 1.3 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -49,7 +49,7 @@ tcl_back_compare ( ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex); code = Tcl_GlobalEval (ti->ti_ii->interp, command); - results = (char *) strdup (ti->ti_ii->interp->result); + results = (char *) ch_strdup (ti->ti_ii->interp->result); ldap_pvt_thread_mutex_unlock (&tcl_interpreter_mutex); free (command); @@ -65,6 +65,6 @@ tcl_back_compare ( send_ldap_result (conn, op, err, NULL, "internal backend error"); - free(results); + free (results); return (err); } diff --git a/servers/slapd/back-tcl/tcl_config.c b/servers/slapd/back-tcl/tcl_config.c index d5378e36a7..6b7ab1f269 100644 --- a/servers/slapd/back-tcl/tcl_config.c +++ b/servers/slapd/back-tcl/tcl_config.c @@ -1,6 +1,6 @@ /* config.c - tcl backend configuration file routine * - * $Id: tcl_config.c,v 1.3 1999/02/17 00:53:59 bcollins Exp $ + * $Id: tcl_config.c,v 1.4 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -49,7 +49,7 @@ tcl_back_db_config ( fname, lineno, 0); return (1); } - ti->script_path = (char *) strdup (argv[1]); + ti->script_path = (char *) ch_strdup (argv[1]); /* use local interpreter */ } else if (strcasecmp (argv[0], "tclrealm") == 0) { @@ -77,7 +77,7 @@ tcl_back_db_config ( (sizeof (struct i_info)); ii->next->count = 0; - ii->next->name = (char *) strdup (argv[1]); + ii->next->name = (char *) ch_strdup (argv[1]); ii->next->interp = NULL; ii->next->next = NULL; ti->ti_ii = ii->next; @@ -91,7 +91,7 @@ tcl_back_db_config ( fname, lineno, 0); return (1); } - ti->ti_bind = (char *) strdup (argv[1]); + ti->ti_bind = (char *) ch_strdup (argv[1]); /* proc for unbinds */ } else if (strcasecmp (argv[0], "unbind") == 0) { @@ -101,7 +101,7 @@ tcl_back_db_config ( fname, lineno, 0); return (1); } - ti->ti_unbind = (char *) strdup (argv[1]); + ti->ti_unbind = (char *) ch_strdup (argv[1]); /* proc for search */ } else if (strcasecmp (argv[0], "search") == 0) { @@ -111,7 +111,7 @@ tcl_back_db_config ( fname, lineno, 0); return (1); } - ti->ti_search = (char *) strdup (argv[1]); + ti->ti_search = (char *) ch_strdup (argv[1]); /* proc for compares */ } else if (strcasecmp (argv[0], "compare") == 0) { @@ -121,7 +121,7 @@ tcl_back_db_config ( fname, lineno, 0); return (1); } - ti->ti_compare = (char *) strdup (argv[1]); + ti->ti_compare = (char *) ch_strdup (argv[1]); /* proc for modify */ } else if (strcasecmp (argv[0], "modify") == 0) { @@ -131,7 +131,7 @@ tcl_back_db_config ( fname, lineno, 0); return (1); } - ti->ti_modify = (char *) strdup (argv[1]); + ti->ti_modify = (char *) ch_strdup (argv[1]); /* proc for modrdn */ } else if (strcasecmp (argv[0], "modrdn") == 0) { @@ -141,7 +141,7 @@ tcl_back_db_config ( fname, lineno, 0); return (1); } - ti->ti_modrdn = (char *) strdup (argv[1]); + ti->ti_modrdn = (char *) ch_strdup (argv[1]); /* proc for add */ } else if (strcasecmp (argv[0], "add") == 0) { @@ -151,7 +151,7 @@ tcl_back_db_config ( fname, lineno, 0); return (1); } - ti->ti_add = (char *) strdup (argv[1]); + ti->ti_add = (char *) ch_strdup (argv[1]); /* proc for delete */ } else if (strcasecmp (argv[0], "delete") == 0) { @@ -161,7 +161,7 @@ tcl_back_db_config ( fname, lineno, 0); return (1); } - ti->ti_delete = (char *) strdup (argv[1]); + ti->ti_delete = (char *) ch_strdup (argv[1]); /* proc for abandon */ } else if (strcasecmp (argv[0], "abandon") == 0) { @@ -171,7 +171,7 @@ tcl_back_db_config ( fname, lineno, 0); return (1); } - ti->ti_search = (char *) strdup (argv[1]); + ti->ti_search = (char *) ch_strdup (argv[1]); } else { Debug (LDAP_DEBUG_ANY, diff --git a/servers/slapd/back-tcl/tcl_delete.c b/servers/slapd/back-tcl/tcl_delete.c index 167e28ab80..653a33d2cb 100644 --- a/servers/slapd/back-tcl/tcl_delete.c +++ b/servers/slapd/back-tcl/tcl_delete.c @@ -1,6 +1,6 @@ /* delete.c - tcl delete routines * - * $Id: tcl_delete.c,v 1.2 1999/02/17 01:05:28 bcollins Exp $ + * $Id: tcl_delete.c,v 1.3 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -45,7 +45,7 @@ tcl_back_delete ( ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex); code = Tcl_GlobalEval (ti->ti_ii->interp, command); - results = (char *) strdup (ti->ti_ii->interp->result); + results = (char *) ch_strdup (ti->ti_ii->interp->result); ldap_pvt_thread_mutex_unlock (&tcl_interpreter_mutex); free (command); @@ -61,6 +61,6 @@ tcl_back_delete ( send_ldap_result (conn, op, err, NULL, "internal backend error"); - free(results); + free (results); return (err); } diff --git a/servers/slapd/back-tcl/tcl_modify.c b/servers/slapd/back-tcl/tcl_modify.c index 2bed7731e3..9817f9590b 100644 --- a/servers/slapd/back-tcl/tcl_modify.c +++ b/servers/slapd/back-tcl/tcl_modify.c @@ -1,6 +1,6 @@ /* modify.c - tcl modify routines * - * $Id: tcl_modify.c,v 1.2 1999/02/17 01:05:28 bcollins Exp $ + * $Id: tcl_modify.c,v 1.3 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -96,7 +96,7 @@ tcl_back_modify ( ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex); code = Tcl_GlobalEval (ti->ti_ii->interp, command); - results = (char *) strdup (ti->ti_ii->interp->result); + results = (char *) ch_strdup (ti->ti_ii->interp->result); ldap_pvt_thread_mutex_unlock (&tcl_interpreter_mutex); free (command); @@ -112,6 +112,6 @@ tcl_back_modify ( send_ldap_result (conn, op, err, NULL, "internal backend error"); - free(results); + free (results); return (err); } diff --git a/servers/slapd/back-tcl/tcl_modrdn.c b/servers/slapd/back-tcl/tcl_modrdn.c index ef979fb339..4f48d62234 100644 --- a/servers/slapd/back-tcl/tcl_modrdn.c +++ b/servers/slapd/back-tcl/tcl_modrdn.c @@ -1,6 +1,6 @@ /* modrdn.c - tcl modify rdn routines * - * $Id: tcl_modrdn.c,v 1.2 1999/02/17 01:05:28 bcollins Exp $ + * $Id: tcl_modrdn.c,v 1.3 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -49,7 +49,7 @@ tcl_back_modrdn ( ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex); code = Tcl_GlobalEval (ti->ti_ii->interp, command); - results = (char *) strdup (ti->ti_ii->interp->result); + results = (char *) ch_strdup (ti->ti_ii->interp->result); ldap_pvt_thread_mutex_unlock (&tcl_interpreter_mutex); free (command); @@ -65,6 +65,6 @@ tcl_back_modrdn ( send_ldap_result (conn, op, err, NULL, "internal backend error"); - free(results); + free (results); return (err); } diff --git a/servers/slapd/back-tcl/tcl_search.c b/servers/slapd/back-tcl/tcl_search.c index 054d855a3d..62eeca165d 100644 --- a/servers/slapd/back-tcl/tcl_search.c +++ b/servers/slapd/back-tcl/tcl_search.c @@ -1,6 +1,6 @@ /* search.c - tcl search routines * - * $Id: tcl_search.c,v 1.2 1999/02/17 01:05:28 bcollins Exp $ + * $Id: tcl_search.c,v 1.3 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -66,7 +66,7 @@ tcl_back_search ( ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex); code = Tcl_GlobalEval (ti->ti_ii->interp, command); - results = (char *) strdup(ti->ti_ii->interp->result); + results = (char *) ch_strdup (ti->ti_ii->interp->result); ldap_pvt_thread_mutex_unlock (&tcl_interpreter_mutex); free (command); @@ -82,6 +82,6 @@ tcl_back_search ( send_ldap_result (conn, op, err, NULL, "internal backend error"); - free(results); + free (results); return (err); } diff --git a/servers/slapd/back-tcl/tcl_unbind.c b/servers/slapd/back-tcl/tcl_unbind.c index dbd6a7d668..1f70c629ff 100644 --- a/servers/slapd/back-tcl/tcl_unbind.c +++ b/servers/slapd/back-tcl/tcl_unbind.c @@ -1,6 +1,6 @@ /* unbind.c - tcl unbind routines * - * $Id: tcl_unbind.c,v 1.2 1999/02/17 01:05:28 bcollins Exp $ + * $Id: tcl_unbind.c,v 1.3 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -31,7 +31,7 @@ tcl_back_unbind ( if (ti->ti_unbind == NULL) { send_ldap_result (conn, op, LDAP_UNWILLING_TO_PERFORM, NULL, "unbind not implemented"); - return(-1); + return (-1); } for (i = 0; be->be_suffix[i] != NULL; i++); @@ -46,7 +46,7 @@ tcl_back_unbind ( ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex); code = Tcl_GlobalEval (ti->ti_ii->interp, command); - results = (char *) strdup (ti->ti_ii->interp->result); + results = (char *) ch_strdup (ti->ti_ii->interp->result); ldap_pvt_thread_mutex_unlock (&tcl_interpreter_mutex); free (command); @@ -55,6 +55,6 @@ tcl_back_unbind ( 0, 0); } - free(results); + free (results); return (err); } diff --git a/servers/slapd/back-tcl/tcl_util.c b/servers/slapd/back-tcl/tcl_util.c index 342e75c5f8..c7e61b0fa0 100644 --- a/servers/slapd/back-tcl/tcl_util.c +++ b/servers/slapd/back-tcl/tcl_util.c @@ -1,6 +1,6 @@ /* result.c - tcl backend utility functions * - * $Id: tcl_util.c,v 1.2 1999/02/17 01:05:28 bcollins Exp $ + * $Id: tcl_util.c,v 1.3 1999/02/18 01:18:39 bcollins Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -125,7 +125,7 @@ tcl_clean_entry ( if (mark1[0] == '\n') { mark1++; } - dup = (char *) strdup (mark1); + dup = (char *) ch_strdup (mark1); if (dup[0] != '\0') { if ((mark2 = (char *) strchr (dup, '\n')) != NULL) { mark2[0] = '\0'; -- 2.39.5