mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
daemon: Close leaked file descriptor along checksum error path (RHBZ#657499).
This commit is contained in:
@@ -61,8 +61,10 @@ checksum (const char *csumtype, int fd)
|
||||
int len;
|
||||
|
||||
program = program_of_csum (csumtype);
|
||||
if (program == NULL)
|
||||
if (program == NULL) {
|
||||
close (fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
flags = COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN | fd;
|
||||
r = commandf (&out, &err, flags, program, NULL);
|
||||
|
||||
Reference in New Issue
Block a user