summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source3/param/loadparm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index c428c23601..94d3b8de57 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -2584,7 +2584,9 @@ bool lp_do_section(const char *pszSectionName, void *userdata)
/* if we've just struck a global section, note the fact. */
bInGlobalSection = isglobal;
- lp_ctx->bInGlobalSection = isglobal;
+ if (lp_ctx != NULL) {
+ lp_ctx->bInGlobalSection = isglobal;
+ }
/* check for multiple global sections */
if (bInGlobalSection) {