From 2f01f08103aac50878c8ed704df5bfddf7443c5a Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 20 Jun 2015 23:38:19 +0300 Subject: [PATCH] password_pbkdf2: fix memory leak Found by: Coverity scan. CID: 96676 --- grub-core/commands/password_pbkdf2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grub-core/commands/password_pbkdf2.c b/grub-core/commands/password_pbkdf2.c index 0dd1aef3d..c6a77c8c5 100644 --- a/grub-core/commands/password_pbkdf2.c +++ b/grub-core/commands/password_pbkdf2.c @@ -104,7 +104,10 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), pass->c = grub_strtoul (ptr, &ptr, 0); if (grub_errno) - return grub_errno; + { + grub_free (pass); + return grub_errno; + } if (*ptr != '.') { grub_free (pass);