diff --git a/grub-core/normal/completion.c b/grub-core/normal/completion.c index c07100a8d..18cadfa85 100644 --- a/grub-core/normal/completion.c +++ b/grub-core/normal/completion.c @@ -401,8 +401,8 @@ char * grub_normal_do_completion (char *buf, int *restore, void (*hook) (const char *, grub_completion_type_t, int)) { - int argc; - char **argv; + int argc = 0; + char **argv = NULL; /* Initialize variables. */ match = 0; @@ -517,10 +517,8 @@ grub_normal_do_completion (char *buf, int *restore, fail: if (argc != 0) - { - grub_free (argv[0]); - grub_free (argv); - } + grub_free (argv[0]); + grub_free (argv); grub_free (match); grub_errno = GRUB_ERR_NONE;