Converted strdup()'s to ch_strdup()

This commit is contained in:
Ben Collins 1999-02-19 07:55:20 +00:00
parent 3a9f96ec0d
commit 809c6570e4
12 changed files with 52 additions and 50 deletions

View File

@ -1,4 +1,4 @@
/* $Id$
/* $Id: Version.c,v 1.2 1999/02/18 01:18:39 bcollins Exp $
*
* Copyright 1999, Ben Collins <bcollins@debian.org>, 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";

View File

@ -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 <bcollins@debian.org>, 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);
}

View File

@ -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 <bcollins@debian.org>, 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);
}

View File

@ -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 <bcollins@debian.org>, 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);
}

View File

@ -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 <bcollins@debian.org>, 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);
}

View File

@ -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 <bcollins@debian.org>, 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,

View File

@ -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 <bcollins@debian.org>, 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);
}

View File

@ -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 <bcollins@debian.org>, 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);
}

View File

@ -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 <bcollins@debian.org>, 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);
}

View File

@ -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 <bcollins@debian.org>, 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);
}

View File

@ -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 <bcollins@debian.org>, 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);
}

View File

@ -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 <bcollins@debian.org>, 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';