Hi Kojima-san,

[...]

> + * eficonfig_destroy() - destroy efimenu
> + *
> + * @efi_menu:        pointer to the efimenu structure
> + * @flag:    flag to free the allocated data
> + */
> +static void eficonfig_destroy(struct efimenu *efi_menu, bool flag)
> +{
> +     struct list_head *pos, *n;
> +     struct eficonfig_entry *entry;
> +
> +     list_for_each_safe(pos, n, &efi_menu->list) {
> +             entry = list_entry(pos, struct eficonfig_entry, list);
> +             free(entry->title);
> +             if (flag)
> +                     free(entry->data);

I don't we need this flag.  entry->data is either set to a valid pointer or
NULL on append_entry().

> +             list_del(&entry->list);
> +             free(entry);
> +     }
> +     free(efi_menu->menu_header);
> +     free(efi_menu);

[...]

Regards
/Ilias

Reply via email to