Skip to content

Commit

Permalink
Merge pull request #2211 from jlebon/pr/close-fd
Browse files Browse the repository at this point in the history
lib/deploy: Don't leak fd when checksumming dtbs
  • Loading branch information
openshift-merge-robot authored Oct 7, 2020
2 parents 84f8de6 + b3dc074 commit 8eb2d5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libostree/ostree-sysroot-deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ checksum_dir_recurse (int dfd,
}
else
{
int fd;
glnx_autofd int fd = -1;

if (!ot_openat_ignore_enoent (dfditer.fd, d_name, &fd, error))
return FALSE;
if (fd != -1)
{
g_autoptr(GInputStream) in = g_unix_input_stream_new (fd, FALSE);
g_autoptr(GInputStream) in = g_unix_input_stream_new (glnx_steal_fd (&fd), TRUE);
if (!ot_gio_splice_update_checksum (NULL, in, checksum, cancellable, error))
return FALSE;
}
Expand Down

0 comments on commit 8eb2d5f

Please sign in to comment.