From e16f004dc0b04c45cd5b16de47968094575d2a38 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 26 Jul 2011 12:19:58 +1000 Subject: s3-loadparm: fixed a memory leak in parametric options before we memset the Globals structure we need to free any global parametrics Pair-Programmed-With: Andrew Bartlett --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 305ff2cec9..21fa662141 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -310,6 +310,7 @@ static void set_allowed_client_auth(void); static void add_to_file_list(const char *fname, const char *subfname); static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue, bool store_values); +static void free_param_opts(struct parmlist_entry **popts); static const struct enum_list enum_protocol[] = { {PROTOCOL_SMB2_02, "SMB2"}, /* for now keep PROTOCOL_SMB2_02 */ @@ -4605,6 +4606,7 @@ static void free_parameters_by_snum(int snum) */ static void free_global_parameters(void) { + free_param_opts(&Globals.param_opt); free_parameters_by_snum(GLOBAL_SECTION_SNUM); } @@ -5420,7 +5422,6 @@ static bool do_section(const char *pszSectionName, void *userdata); static void init_copymap(struct loadparm_service *pservice); static bool hash_a_service(const char *name, int number); static void free_service_byindex(int iService); -static void free_param_opts(struct parmlist_entry **popts); static void show_parameter(int parmIndex); static bool is_synonym_of(int parm1, int parm2, bool *inverse); -- cgit