[rtems commit] shell/main_blksync.c: Fix leak of file descriptor
Joel Sherril
joel at rtems.org
Tue Nov 25 18:57:22 UTC 2014
Module: rtems
Branch: master
Commit: 630642e21c44bd953e41bfd5aaf2fb8a4528ed77
Changeset: http://git.rtems.org/rtems/commit/?id=630642e21c44bd953e41bfd5aaf2fb8a4528ed77
Author: Joel Sherrill <joel.sherrill at oarcorp.com>
Date: Mon Nov 24 14:14:35 2014 -0600
shell/main_blksync.c: Fix leak of file descriptor
Coverity Id 1063887. File descriptor not freed on error path.
---
cpukit/libmisc/shell/main_blksync.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/cpukit/libmisc/shell/main_blksync.c b/cpukit/libmisc/shell/main_blksync.c
index 7c32b79f..9b1cd24 100644
--- a/cpukit/libmisc/shell/main_blksync.c
+++ b/cpukit/libmisc/shell/main_blksync.c
@@ -58,6 +58,7 @@ static int rtems_shell_main_blksync(
if (rtems_disk_fd_sync (fd) < 0) {
fprintf( stderr, "%s: driver sync failed: %s\n", argv[0], strerror (errno));
+ close (fd);
return 1;
}
More information about the vc
mailing list