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 authored and Atomic Bot committed 2016-09-13 13:19:10 +00:00
1 parent a5af1cb688
commit a8301b909c
1 file changed
+4 -1
+4 -1
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;
}
}
/**