[PATCH 07 of 16] The file handle will leak if fread fails
1 file changed, 2 insertions(+), 1 deletion(-)
alias.c | 3 ++-
# HG changeset patch
# User Erik Hovland <erik@xxxxxxxxxxx>
# Date 1236895972 25200
# Branch HEAD
# Node ID d03156127b1d7fae9f44802d1a60f2c5b4ee744a
# Parent 43c02f38d2127c88da18495a6c9c7c1bf5e007a7
The file handle will leak if fread fails.
diff --git a/alias.c b/alias.c
--- a/alias.c
+++ b/alias.c
@@ -359,7 +359,7 @@
if (fread(buf, 1, 1, rc) != 1)
{
mutt_perror (_("Error reading alias file"));
- return;
+ goto fread_err;
}
if (fseek (rc, 0, SEEK_END) < 0)
goto fseek_err;
@@ -388,6 +388,7 @@
fseek_err:
mutt_perror (_("Error seeking in alias file"));
+ fread_err:
fclose(rc);
return;
}