summaryrefslogtreecommitdiffstats
path: root/source3/param/loadparm.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/param/loadparm.c')
-rw-r--r--source3/param/loadparm.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 31f6203dd5..f4ec225626 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -660,7 +660,11 @@ static void init_globals(bool reinit_globals)
ZERO_STRUCT(Globals);
Globals.ctx = talloc_pooled_object(NULL, char, 272, 2048);
- flags_list = talloc_zero_array(Globals.ctx, unsigned int, num_parameters());
+
+ /* Initialize the flags list if necessary */
+ if (flags_list == NULL) {
+ get_flags();
+ }
for (i = 0; parm_table[i].label; i++) {
if ((parm_table[i].type == P_STRING ||
@@ -4627,3 +4631,12 @@ struct loadparm_global * get_globals(void)
{
return &Globals;
}
+
+unsigned int * get_flags(void)
+{
+ if (flags_list == NULL) {
+ flags_list = talloc_zero_array(NULL, unsigned int, num_parameters());
+ }
+
+ return flags_list;
+}