From 8c76eb2672343007bc5de60487e01a87fd76f799 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 14 Feb 2005 10:08:10 +0000 Subject: r5395: fixed some loadparm memory leaks (This used to be commit b75f8fe1844c539d8a4e369225bcbe0e6f81e9de) --- source4/param/loadparm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 23551bd1c6..4d6282573b 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -1444,7 +1444,7 @@ const char **lp_parm_string_list(int lookup_service, const char *type, const cha const char *value = get_parametrics(lookup_service, type, option); if (value) - return str_list_make(NULL, value, separator); + return str_list_make(talloc_autofree_context(), value, separator); return NULL; } @@ -1862,7 +1862,8 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL strupper(*(char **)dest_ptr); break; case P_LIST: - *(const char ***)dest_ptr = str_list_copy(NULL, *(const char ***)src_ptr); + *(const char ***)dest_ptr = str_list_copy(talloc_autofree_context(), + *(const char ***)src_ptr); break; default: break; @@ -2374,7 +2375,8 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue break; case P_LIST: - *(const char ***)parm_ptr = str_list_make(NULL, pszParmValue, NULL); + *(const char ***)parm_ptr = str_list_make(talloc_autofree_context(), + pszParmValue, NULL); break; case P_STRING: @@ -2934,7 +2936,7 @@ static void lp_save_defaults(void) continue; switch (parm_table[i].type) { case P_LIST: - parm_table[i].def.lvalue = str_list_copy(NULL, + parm_table[i].def.lvalue = str_list_copy(talloc_autofree_context(), *(const char ***)parm_table[i].ptr); break; case P_STRING: -- cgit