mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 04:25:06 -05:00
conf: free refclock strings on exit
Free driver name and parameter of configured refclocks in helpers on exit.
This commit is contained in:
10
conf.c
10
conf.c
@@ -422,6 +422,10 @@ CNF_Finalise(void)
|
||||
Free(((NTP_Source *)ARR_GetElement(ntp_sources, i))->params.name);
|
||||
for (i = 0; i < ARR_GetSize(ntp_source_dirs); i++)
|
||||
Free(*(char **)ARR_GetElement(ntp_source_dirs, i));
|
||||
for (i = 0; i < ARR_GetSize(refclock_sources); i++) {
|
||||
Free(((RefclockParameters *)ARR_GetElement(refclock_sources, i))->driver_name);
|
||||
Free(((RefclockParameters *)ARR_GetElement(refclock_sources, i))->driver_parameter);
|
||||
}
|
||||
|
||||
ARR_DestroyInstance(init_sources);
|
||||
ARR_DestroyInstance(ntp_sources);
|
||||
@@ -1839,10 +1843,14 @@ CNF_AddSources(void)
|
||||
void
|
||||
CNF_AddRefclocks(void)
|
||||
{
|
||||
RefclockParameters *refclock;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ARR_GetSize(refclock_sources); i++) {
|
||||
RCL_AddRefclock((RefclockParameters *)ARR_GetElement(refclock_sources, i));
|
||||
refclock = ARR_GetElement(refclock_sources, i);
|
||||
RCL_AddRefclock(refclock);
|
||||
Free(refclock->driver_name);
|
||||
Free(refclock->driver_parameter);
|
||||
}
|
||||
|
||||
ARR_SetSize(refclock_sources, 0);
|
||||
|
||||
Reference in New Issue
Block a user