From 403ac796a5067ac558ceca2409270eb55b477299 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 26 Nov 2010 10:18:29 +0000 Subject: [PATCH] daemon: Close leaked file descriptor along checksum error path (RHBZ#657499). --- daemon/checksum.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 1.8.3.1