From 151c19a42a8ea76395fdb579221198156da9c026 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 30 Jan 2015 22:45:58 +0300 Subject: [PATCH] grub-fstest: fix descriptor leak Found by: Coverity scan. --- util/grub-fstest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 31af2a7ad..02cd3e3e2 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -570,12 +570,12 @@ argp_parser (int key, char *arg, struct argp_state *state) return 0; } real_size = fread (buf, 1, 1024, f); + fclose (f); if (real_size < 0) { printf (_("%s: error:"), program_name); printf (_("cannot read `%s': %s"), arg, strerror (errno)); printf ("\n"); - fclose (f); return 0; } grub_zfs_add_key (buf, real_size, 0);