diff options
Diffstat (limited to 'source3/param')
-rw-r--r-- | source3/param/loadparm.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6919f5eced..6ad2c32628 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3422,13 +3422,19 @@ static void lp_save_defaults(void) break; case P_STRING: case P_USTRING: - parm_table[i].def.svalue = - strdup(*(char **)parm_table[i].ptr); + if (parm_table[i].ptr) { + parm_table[i].def.svalue = strdup(*(char **)parm_table[i].ptr); + } else { + parm_table[i].def.svalue = NULL; + } break; case P_GSTRING: case P_UGSTRING: - parm_table[i].def.svalue = - strdup((char *)parm_table[i].ptr); + if (parm_table[i].ptr) { + parm_table[i].def.svalue = strdup((char *)parm_table[i].ptr); + } else { + parm_table[i].def.svalue = NULL; + } break; case P_BOOL: case P_BOOLREV: |