commit ab0d43616704b463cc02e5c8ea982dcf10f83f4b from: Stefan Sperling date: Fri Dec 13 12:00:10 2019 UTC fix leak in an error path of get_file_status() commit - 882ef1b90ea13c3e6642cdd8af148fb08bbeda02 commit + ab0d43616704b463cc02e5c8ea982dcf10f83f4b blob - 626e3c574541edf235f43bb2ba2538ca27cf9f53 blob + 2e614c890d931081960fe19a11e0d4e1f71b6022 --- lib/worktree.c +++ lib/worktree.c @@ -1184,8 +1184,10 @@ get_file_status(unsigned char *status, struct stat *sb if (dirfd != -1) { fd = openat(dirfd, de_name, O_RDONLY | O_NOFOLLOW); - if (fd == -1) - return got_error_from_errno2("openat", abspath); + if (fd == -1) { + err = got_error_from_errno2("openat", abspath); + goto done; + } } f = fdopen(fd, "r");