cmdparse: don't duplicate hostname in CPS_ParseNTPSourceAdd()

Let the caller duplicate the string if needed.
This commit is contained in:
Miroslav Lichvar
2014-09-24 12:41:38 +02:00
parent 336473398a
commit d466390233
3 changed files with 4 additions and 21 deletions

1
conf.c
View File

@@ -529,6 +529,7 @@ parse_source(char *line, NTP_Source_Type type)
switch (status) {
case CPS_Success:
ntp_sources[n_ntp_sources].params.name = Strdup(ntp_sources[n_ntp_sources].params.name);
n_ntp_sources++;
break;
case CPS_BadOption: