summaryrefslogtreecommitdiff
path: root/source3/param/loadparm.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/param/loadparm.c')
-rw-r--r--source3/param/loadparm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 2249c8b473..dda31f3efe 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -2144,8 +2144,7 @@ static void lp_add_auto_services(char *str)
{
char *s;
char *p;
- int homes = lp_servicenumber(HOMES_NAME);
- int printers = lp_servicenumber(PRINTERS_NAME);
+ int homes, printers;
if (!str)
return;
@@ -2153,6 +2152,9 @@ static void lp_add_auto_services(char *str)
s = strdup(str);
if (!s) return;
+ homes = lp_servicenumber(HOMES_NAME);
+ printers = lp_servicenumber(PRINTERS_NAME);
+
for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP))
{
char *home = get_home_dir(p);