daemon: Close leaked file descriptor along checksum error path (RHBZ#657499).

This commit is contained in:
Richard W.M. Jones
2010-11-26 10:18:29 +00:00
parent 746c4b7789
commit 403ac796a5

View File

@@ -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);