From: Richard W.M. Jones Date: Fri, 26 Nov 2010 10:18:29 +0000 (+0000) Subject: daemon: Close leaked file descriptor along checksum error path (RHBZ#657499). X-Git-Tag: 1.7.15~6 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=403ac796a5067ac558ceca2409270eb55b477299;p=libguestfs.git daemon: Close leaked file descriptor along checksum error path (RHBZ#657499). --- diff --git a/daemon/checksum.c b/daemon/checksum.c index 7967f0c..cdb0a18 100644 --- a/daemon/checksum.c +++ b/daemon/checksum.c @@ -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);