]> git.tdb.fi Git - ext/subsurface.git/commit
file.c: Fix a file descriptor leak in readfile()
authorAndrew Clayton <andrew@digital-domain.net>
Thu, 12 Jul 2012 22:28:47 +0000 (23:28 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 13 Jul 2012 01:19:47 +0000 (18:19 -0700)
commit7fe652ab5738717ba443ae9de2b8f437103fd71b
tree707aafc488689dcf882d2942fdbcde7ba1335ab9
parenta3ead9fb862207749d23368db9b857559c0dde78
file.c: Fix a file descriptor leak in readfile()

In file.c::readfile() the file was being opened once at fd declaration
time and then again a few lines later and only being closed once. Remove
the open() at fd declaration time leaving the later one where the fd check
is done.

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
file.c