]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
nts: close file after loading cookies
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 3 May 2021 12:15:28 +0000 (14:15 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 5 May 2021 10:41:23 +0000 (12:41 +0200)
Don't forget to close the file with cookies in ntsdumpdir if
successfully loaded.

Fixes: 2fa83b541c36 ("nts: save and load cookies on client")
nts_ntp_client.c

index 5de97ee23aa423b125d49598ccb23788f81f502a..4b16ffdb950fd248ad129621f51b6eb921845565 100644 (file)
@@ -669,6 +669,8 @@ load_cookies(NNC_Instance inst)
   inst->last_nke_success = context_time + SCH_GetLastEventMonoTime();
   inst->context_id = context_id;
 
+  fclose(f);
+
   DEBUG_LOG("Loaded %d cookies for %s", i, filename);
   return;