_alpm_pkg_load_internal: prevent double closing file descriptor
Move closing of the file descriptor until the end of the function, as any following error will lead to a "goto error" that attempts to close it again. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
ea83fd3927
commit
19a8587459
1 changed files with 1 additions and 1 deletions
|
@ -653,7 +653,6 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle,
|
|||
}
|
||||
|
||||
_alpm_archive_read_free(archive);
|
||||
close(fd);
|
||||
|
||||
/* internal fields for package struct */
|
||||
newpkg->origin = ALPM_PKG_FROM_FILE;
|
||||
|
@ -676,6 +675,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle,
|
|||
newpkg->infolevel |= INFRQ_FILES;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return newpkg;
|
||||
|
||||
pkg_invalid:
|
||||
|
|
Loading…
Add table
Reference in a new issue