Thanks to Olaf Rempel for this patch.
if (fgets (buffer, 16, fp) == NULL)
{
syslog (LOG_WARNING, "cpufreq: fgets: %s", strerror (errno));
+ fclose (fp);
return;
}
syslog (LOG_ERR, "hddtemp: Error reading from socket: %s",
strerror (errno));
+ close (fd);
return (-1);
}
buffer_fill += status;
first_hddname = entry;
}
}
+ fclose (fh);
}
else
DBG ("Could not open /proc/partitions: %s",
if (fgets (buffer, 16, loadavg) == NULL)
{
syslog (LOG_WARNING, "load: fgets: %s", strerror (errno));
+ fclose (loadavg);
return;
}