Skip to contentSkip to conversation

The memory allocated by the 'grub_parser_split_cmdline()' is leaked.

DISCUSSION Hitoshi Ozeki 2 participants 2 messages Apr 10, 2007 – Sep 3, 2007

lore
Share & tools
lore
#0 lore raw

Hello, all.

Please see line 204 and 209 on the 'grub-1.95/kern/parser.c'.

This code allocates memory. it stores arguments.

-begin----------------------------------------------------------------------
---------
/* Reserve memory for the return values. */
args = grub_malloc (bp - buffer);
if (! args)

    return grub_errno;

grub_memcpy (args, buffer, bp - buffer);

*argv = grub_malloc (sizeof (char *) * (*argc + 1)); if (! *argv)

    {
      grub_free (args);
      return grub_errno;
    }

-end------------------------------------------------------------------------
---------

And this code is called from 'grub_normal_do_completion ()' and 'grub_enter_rescue_mode ()'. But I cannot find the codes release its memory. Maybe leaks it.

Signature · 1 line
 Hitoshi Ozeki [email protected]
#1 lore raw
Quoted 3 lines · Hitoshi Ozeki

And this code is called from 'grub_normal_do_completion ()' and 'grub_enter_rescue_mode ()'. But I cannot find the codes release its memory. Maybe leaks it.

Fixed. Thank you.

Okuji