Message192077
Under rare circumstances listdir() could leak a FD:
- HAVE_FDOPENDIR is defined
- dup(fd) succeeds
- fdopendir() fails and sets dirp to NULL
- if (dirp == NULL) goto exit
- the dupped fd isn't closed because exit just handles dirp != NULL.
Proposed fix:
if (dirp != NULL) {
...
} else if (fd != -1) {
close(fd);
}
CID 992693 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable "fd" going out of scope leaks the handle |
|
Date |
User |
Action |
Args |
2013-06-30 16:47:57 | christian.heimes | set | recipients:
+ christian.heimes |
2013-06-30 16:47:57 | christian.heimes | set | messageid: <1372610877.27.0.117914198257.issue18332@psf.upfronthosting.co.za> |
2013-06-30 16:47:57 | christian.heimes | link | issue18332 messages |
2013-06-30 16:47:56 | christian.heimes | create | |
|