Rather than tallocing global parameters off NULL, keep it neat by having
a Global.ctx member.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
$file->(" * This structure describes global (ie., server-wide) parameters.\n");
$file->(" */\n");
$file->("struct loadparm_global \n");
+ $file->("{\n");
+ $file->("\tTALLOC_CTX *ctx; /* Context for talloced members */\n");
} elsif ($generate_scope eq "LOCAL") {
$file->(" * This structure describes a single service.\n");
$file->(" */\n");
$file->("struct loadparm_service \n");
+ $file->("{\n");
}
-$file->("{\n");
}
sub print_footer($$$)
{
free_param_opts(&Globals.param_opt);
free_parameters_by_snum(GLOBAL_SECTION_SNUM);
+ TALLOC_FREE(Globals.ctx);
}
static int map_parameter(const char *pszParmName);
* table once the defaults are set */
ZERO_STRUCT(Globals);
+ Globals.ctx = talloc_new(NULL);
+
for (i = 0; parm_table[i].label; i++) {
if ((parm_table[i].type == P_STRING ||
parm_table[i].type == P_USTRING))