mirror of
https://github.com/samba-team/samba.git
synced 2025-01-17 02:05:21 +03:00
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 commit is contained in:
parent
c879ed3d1e
commit
0523ad2493
@ -44,14 +44,13 @@
|
|||||||
#define LDB_MODULE_PREFIX "modules:"
|
#define LDB_MODULE_PREFIX "modules:"
|
||||||
#define LDB_MODULE_PREFIX_LEN 8
|
#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;
|
int i, len;
|
||||||
char *trimmed;
|
char *trimmed;
|
||||||
|
|
||||||
trimmed = talloc_strdup(ldb, string);
|
trimmed = talloc_strdup(mem_ctx, string);
|
||||||
if (!trimmed) {
|
if (!trimmed) {
|
||||||
ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in talloc_strdup_trim_spaces()\n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,9 +80,9 @@ const char **ldb_modules_list_from_string(struct ldb_context *ldb, TALLOC_CTX *m
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* spaces not admitted */
|
/* spaces not admitted */
|
||||||
modstr = talloc_strdup_no_spaces((struct ldb_context *)mem_ctx,
|
modstr = ldb_modules_strdup_no_spaces(mem_ctx, string);
|
||||||
string);
|
|
||||||
if ( ! modstr) {
|
if ( ! modstr) {
|
||||||
|
ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_strdup_no_spaces()\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user