From 4120652df4820a3db46a9693a8dd3ab50ca75530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Wed, 8 Sep 2010 19:53:50 +0000 Subject: [PATCH] keybox: do not leak filehandle when the wrong password is entered. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28047 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/keybox.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/plugins/keybox.c b/apps/plugins/keybox.c index 8ac4064996..af41b3fdd8 100644 --- a/apps/plugins/keybox.c +++ b/apps/plugins/keybox.c @@ -554,10 +554,10 @@ static int keybox(void) return FILE_OPEN_ERROR; bytes_read = rb->read(fd, &buffer, sizeof(buffer)); + rb->close(fd); + if (parse_buffer()) return 0; - - rb->close(fd); } while (!done)