mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 10:25:06 -05:00
conf: reset global pointers after parsing line
Don't leave dangling pointers in CNF_ParseLine().
This commit is contained in:
6
conf.c
6
conf.c
@@ -491,8 +491,10 @@ CNF_ParseLine(const char *filename, int number, char *line)
|
|||||||
CPS_NormalizeLine(line);
|
CPS_NormalizeLine(line);
|
||||||
|
|
||||||
/* Skip blank lines */
|
/* Skip blank lines */
|
||||||
if (!*line)
|
if (!*line) {
|
||||||
|
processed_file = NULL;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* We have a real line, now try to match commands */
|
/* We have a real line, now try to match commands */
|
||||||
processed_command = command = line;
|
processed_command = command = line;
|
||||||
@@ -673,6 +675,8 @@ CNF_ParseLine(const char *filename, int number, char *line)
|
|||||||
} else {
|
} else {
|
||||||
other_parse_error("Invalid command");
|
other_parse_error("Invalid command");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processed_file = processed_command = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|||||||
Reference in New Issue
Block a user