ostree_sysroot.c: Don't close sysroot_fd twice.

If ostree_sysroot_unload() was called explicitly, then sysroot_fd
would be closed again at finalization time, possibly closing a
random file descriptor belonging to some other part of the
application.

Closes: #507
Approved by: cgwalters
This commit is contained in:
Owen W. Taylor 2016-09-13 09:05:52 -04:00 committed by Atomic Bot
parent a5af1cb688
commit a8301b909c
1 changed files with 4 additions and 1 deletions

View File

@ -260,7 +260,10 @@ void
ostree_sysroot_unload (OstreeSysroot *self)
{
if (self->sysroot_fd != -1)
(void) close (self->sysroot_fd);
{
(void) close (self->sysroot_fd);
self->sysroot_fd = -1;
}
}
/**