From a8301b909c61d2e326cf5e4557f672ccd9f457bf Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 13 Sep 2016 09:05:52 -0400 Subject: [PATCH] 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 --- src/libostree/ostree-sysroot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c index 37063e28..de92691a 100644 --- a/src/libostree/ostree-sysroot.c +++ b/src/libostree/ostree-sysroot.c @@ -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; + } } /**