svn commit: samba r19135 - in
branches/SAMBA_3_0/source/lib/ldb/common: .
metze at samba.org
metze at samba.org
Fri Oct 6 15:06:54 GMT 2006
Author: metze
Date: 2006-10-06 15:06:54 +0000 (Fri, 06 Oct 2006)
New Revision: 19135
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19135
Log:
fix bugs...
- passing mem_ctx as ldb_context is a bad idea!
- naming a static function talloc_ is also bad and misleading
metze
Modified:
branches/SAMBA_3_0/source/lib/ldb/common/ldb_modules.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/ldb/common/ldb_modules.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/common/ldb_modules.c 2006-10-06 15:03:41 UTC (rev 19134)
+++ branches/SAMBA_3_0/source/lib/ldb/common/ldb_modules.c 2006-10-06 15:06:54 UTC (rev 19135)
@@ -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 @@
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;
}
More information about the samba-cvs
mailing list