]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Fix possible leaks of temporary file names
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 21 Jun 2013 14:08:14 +0000 (16:08 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 21 Jun 2013 14:09:20 +0000 (16:09 +0200)
reference.c
rtc_linux.c

index d86d2b78a5aa30b2c2197bfb20675ae9a56837f0..12e6bebf2e0a1563d31b8c08c91f90d9136cb5b8 100644 (file)
@@ -313,6 +313,7 @@ update_drift_file(double freq_ppm, double skew)
   /* Write the frequency and skew parameters in ppm */
   if ((fprintf(out, "%20.6f %20.6f\n", freq_ppm, 1.0e6 * skew) < 0) |
       fclose(out)) {
+    Free(temp_drift_file);
     LOG(LOGS_WARN, LOGF_Reference, "Could not write to temporary driftfile %s.tmp",
         drift_file);
     return;
index 2c5242646f726426fdbbbdec0c02e2217bf1ea57..9fe0ffb293e0ce6b643d01a322b61555c815a4cb 100644 (file)
@@ -453,6 +453,7 @@ write_coefs_to_file(int valid,time_t ref_time,double offset,double rate)
   if ((fprintf(out, "%1d %ld %.6f %.3f\n",
           valid,ref_time, offset, 1.0e6 * rate) < 0) |
       fclose(out)) {
+    Free(temp_coefs_file_name);
     LOG(LOGS_WARN, LOGF_RtcLinux, "Could not write to temporary RTC file %s.tmp",
         coefs_file_name);
     return RTC_ST_BADFILE;