summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-02-04 20:57:35 +0100
committerVolker Lendecke <vl@samba.org>2008-02-04 20:57:49 +0100
commit2762b9a97582b9b28fd5985ba8e3d0299126820e (patch)
treebcaa02c53a19e332ac20c41377e4951caed8d4a9 /source3/lib
parent3955801298bbcf69afe01c212d5e8ac9812a5dcf (diff)
downloadsamba-2762b9a97582b9b28fd5985ba8e3d0299126820e.tar.gz
samba-2762b9a97582b9b28fd5985ba8e3d0299126820e.tar.bz2
samba-2762b9a97582b9b28fd5985ba8e3d0299126820e.zip
Always pass a TALLOC_CTX to str_list_make and str_list_copy
(This used to be commit e2c9fc4cf5f0ff725330fa44f53782db65fca37e)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/debug.c6
-rw-r--r--source3/lib/util_str.c13
2 files changed, 6 insertions, 13 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 51bb0d7541..9ff267b607 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -460,14 +460,14 @@ bool debug_parse_levels(const char *params_str)
if (AllowDebugChange == False)
return True;
- params = str_list_make(params_str, NULL);
+ params = str_list_make(talloc_tos(), params_str, NULL);
if (debug_parse_params(params)) {
debug_dump_status(5);
- str_list_free(&params);
+ TALLOC_FREE(params);
return True;
} else {
- str_list_free(&params);
+ TALLOC_FREE(params);
return False;
}
}
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 05be7ca1e4..fb3392f041 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1902,19 +1902,12 @@ static char **str_list_make_internal(TALLOC_CTX *mem_ctx, const char *string,
return list;
}
-char **str_list_make_talloc(TALLOC_CTX *mem_ctx,
- const char *string,
- const char *sep)
+char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
{
return str_list_make_internal(mem_ctx, string, sep);
}
-char **str_list_make(const char *string, const char *sep)
-{
- return str_list_make_internal(NULL, string, sep);
-}
-
-bool str_list_copy(char ***dest, const char **src)
+bool str_list_copy(TALLOC_CTX *mem_ctx, char ***dest, const char **src)
{
char **list;
int i, num;
@@ -1928,7 +1921,7 @@ bool str_list_copy(char ***dest, const char **src)
num += 1;
}
- list = TALLOC_ARRAY(NULL, char *, num+1);
+ list = TALLOC_ARRAY(mem_ctx, char *, num+1);
if (list == NULL) {
return false;
}