* grub-core/kern/misc.c (grub_xvasprintf): Fix an exit path which

resulted in leak of arguments.
This commit is contained in:
Andreas Vogel 2012-02-29 19:35:19 +01:00 committed by Vladimir 'phcoder' Serbinenko
parent fa6ec5734f
commit 3809cb41bc
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2012-02-29 Andreas Vogel <anvoit>
* grub-core/kern/misc.c (grub_xvasprintf): Fix an exit path which
resulted in leak of arguments.
2012-02-29 Vladimir Serbinenko <phcoder@gmail.com> 2012-02-29 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/boot/i386/pc/startup_raw.S: Use separate * grub-core/boot/i386/pc/startup_raw.S: Use separate

View file

@ -1060,11 +1060,12 @@ grub_xvasprintf (const char *fmt, va_list ap)
while (1) while (1)
{ {
va_list ap2; va_list ap2;
va_copy (ap2, ap);
ret = grub_malloc (as + 1); ret = grub_malloc (as + 1);
if (!ret) if (!ret)
return NULL; return NULL;
va_copy (ap2, ap);
s = grub_vsnprintf_real (ret, as, fmt, ap2); s = grub_vsnprintf_real (ret, as, fmt, ap2);
va_end (ap2); va_end (ap2);