diff options
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/config.c b/src/config.c index 87c959a59..11a772832 100644 --- a/src/config.c +++ b/src/config.c @@ -1189,13 +1189,20 @@ int read_config(int reload) s = strtok(ServicesRoot, " "); do { - RootNumber++; - ServicesRoots = - realloc(ServicesRoots, sizeof(char *) * RootNumber); - ServicesRoots[RootNumber - 1] = sstrdup(s); + if (s) { + RootNumber++; + ServicesRoots = + realloc(ServicesRoots, sizeof(char *) * RootNumber); + ServicesRoots[RootNumber - 1] = sstrdup(s); + } } while ((s = strtok(NULL, " "))); } + if (!RootNumber) { + error(0, "No ServicesRoot defined"); + retval = 0; + } + /* Ulines */ if (UlineServers) { @@ -1203,9 +1210,11 @@ int read_config(int reload) s = strtok(UlineServers, " "); do { - NumUlines++; - Ulines = realloc(Ulines, sizeof(char *) * NumUlines); - Ulines[NumUlines - 1] = sstrdup(s); + if (s) { + NumUlines++; + Ulines = realloc(Ulines, sizeof(char *) * NumUlines); + Ulines[NumUlines - 1] = sstrdup(s); + } } while ((s = strtok(NULL, " "))); } |