summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-06 15:06:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:15 -0500
commit3652a2360fcbd254f6b15c54176505c0c59a97e7 (patch)
treedd9439d338c14b9250365d15ba7f739729a6af19 /source3
parent695c6fbe007445e8e63c7d820b14322ece3edbf5 (diff)
downloadsamba-3652a2360fcbd254f6b15c54176505c0c59a97e7.tar.gz
samba-3652a2360fcbd254f6b15c54176505c0c59a97e7.tar.bz2
samba-3652a2360fcbd254f6b15c54176505c0c59a97e7.zip
r19135: fix bugs...
- passing mem_ctx as ldb_context is a bad idea! - naming a static function talloc_ is also bad and misleading metze (This used to be commit 0523ad249335c6094854bc9cefb46e2095f4c0ba)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/ldb/common/ldb_modules.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/lib/ldb/common/ldb_modules.c b/source3/lib/ldb/common/ldb_modules.c
index 5ad56213b6..2a6bc5abae 100644
--- a/source3/lib/ldb/common/ldb_modules.c
+++ b/source3/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;
}