crypto: Fix use after free.
authorAppChecker <appchecker>
Sun, 9 Jul 2017 19:57:35 +0000 (21:57 +0200)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 9 Jul 2017 19:57:35 +0000 (21:57 +0200)
Reported by: AppChecker
Transformed to patch by: Satish Govindarajan

grub-core/normal/crypto.c

index 2bfd67c..e6d345f 100644 (file)
@@ -147,8 +147,8 @@ read_crypto_list (const char *prefix)
       if (! cur->modname)
        {
          grub_errno = GRUB_ERR_NONE;
-         grub_free (cur);
          grub_free (cur->name);
+         grub_free (cur);
          continue;
        }
       cur->next = crypto_specs;