]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
password_pbkdf2: fix memory leak
authorAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 20 Jun 2015 20:38:19 +0000 (23:38 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 20 Jun 2015 20:38:19 +0000 (23:38 +0300)
Found by: Coverity scan.
CID: 96676

grub-core/commands/password_pbkdf2.c

index 0dd1aef3d9957fd6906f72dca13000faec50daac..c6a77c8c5324d9c7aa321c3742bd3e1c690aecea 100644 (file)
@@ -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);