Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.2:Rings:1-MinimalX
libcdaudio
libcdaudio-closedir.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libcdaudio-closedir.diff of Package libcdaudio
--- src/coverart.c +++ src/coverart.c @@ -279,6 +279,7 @@ { DIR *coverart_dir; int index, coverart_fd; + int retval = 0; char root_dir[256], procbuffer[256], id[CDINDEX_ID_SIZE]; struct stat st; struct dirent *d; @@ -319,25 +320,32 @@ art->art_mime_type[0] = '\0'; snprintf(procbuffer, 256, "%s/%s", root_dir, d->d_name); - if(stat(procbuffer, &st) < 0) - return -1; + if(stat(procbuffer, &st) < 0) { + retval = -1; + goto cleanup; + } art->art_length = st.st_size; - if((coverart_fd = open(procbuffer, O_RDONLY)) < 0) - return -1; + if((coverart_fd = open(procbuffer, O_RDONLY)) < 0) { + retval = -1; + goto cleanup; + } - if(read(coverart_fd, art->art_image, art->art_length) < 0) - return -1; + if(read(coverart_fd, art->art_image, art->art_length) < 0) { + retval = -1; + } art->art_present = 1; - - return 0; + goto cleanup; } } art->art_present = 0; + +cleanup: + closedir(coverart_dir); - return 0; + return retval; } /* Write cover art to local cache */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor