Projects
Eulaceura:Mainline:GA
lshw
_service:obs_scm:lshw-B.02.18-scandir.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:lshw-B.02.18-scandir.patch of Package lshw
diff --git a/src/core/abi.cc b/src/core/abi.cc index 76c664c..b5bd9c9 100644 --- a/src/core/abi.cc +++ b/src/core/abi.cc @@ -36,13 +36,15 @@ bool scan_abi(hwNode & system) struct dirent **namelist; n = scandir(".", &namelist, selectfile, alphasort); - for(i=0; i<n; i++) - { - system.addCapability(namelist[i]->d_name); - free(namelist[i]); + if (n > 0) { + for(i=0; i<n; i++) + { + system.addCapability(namelist[i]->d_name); + free(namelist[i]); + } + if(namelist) + free(namelist); } - if(namelist) - free(namelist); } popd();
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2