crypto: Fix use after free.
[grub.git] / 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;