Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-10177

Resource leak in sensors.c reported by Coverity

XMLWordPrintable

      In src/libs/zbxsysinfo/linux/sensors.c in function get_device_sensors() we have:

      	if (NULL == (devicedir = opendir(hwmon_dir)))
      		return;
      
      	while (NULL != (deviceent = readdir(devicedir)))
      	{
      ...
      				if (NULL == (sensordir = opendir(devicepath)))
      					return;
      ...
      	}
      	closedir(devicedir);
      

      Apparently, second return must be replaced with goto out; and out: must be placed before closedir(devicedir).

            Unassigned Unassigned
            glebs.ivanovskis Glebs Ivanovskis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: