summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_modules.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-09 09:56:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:52 -0500
commitbbc056e067e1b721dc2ef6958ab653c1eddec3a1 (patch)
treed91e02862aba1d29bf8060748cadee34c66cf805 /source4/lib/ldb/common/ldb_modules.c
parentd66e80c650ac16c9553223aac0cce7989831569b (diff)
downloadsamba-bbc056e067e1b721dc2ef6958ab653c1eddec3a1.tar.gz
samba-bbc056e067e1b721dc2ef6958ab653c1eddec3a1.tar.bz2
samba-bbc056e067e1b721dc2ef6958ab653c1eddec3a1.zip
r19196: merge from samba3:
pass always a mem_ctx to functions and a ldb_context where needed metze (This used to be commit 67a6a41ba3af840cd8226de73576a90ecf602caa)
Diffstat (limited to 'source4/lib/ldb/common/ldb_modules.c')
-rw-r--r--source4/lib/ldb/common/ldb_modules.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index 3b0009ae47..d627f3b9fa 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -44,14 +44,13 @@
#define LDB_MODULE_PREFIX "modules:"
#define LDB_MODULE_PREFIX_LEN 8
-static char *talloc_strdup_no_spaces(struct ldb_context *ldb, const char *string)
+static char *ldb_modules_strdup_no_spaces(TALLOC_CTX *mem_ctx, const char *string)
{
int i, len;
char *trimmed;
- trimmed = talloc_strdup(ldb, string);
+ trimmed = talloc_strdup(mem_ctx, string);
if (!trimmed) {
- ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in talloc_strdup_trim_spaces()\n");
return NULL;
}
@@ -81,9 +80,9 @@ const char **ldb_modules_list_from_string(struct ldb_context *ldb, TALLOC_CTX *m
int i;
/* spaces not admitted */
- modstr = talloc_strdup_no_spaces((struct ldb_context *)mem_ctx,
- string);
+ modstr = ldb_modules_strdup_no_spaces(mem_ctx, string);
if ( ! modstr) {
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_strdup_no_spaces()\n");
return NULL;
}