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

    Details

      Description

      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).

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: