From c7dcd67d56701a10c14019b17c9499249ab6c252 Mon Sep 17 00:00:00 2001
From: Yaroslav Miroshnychenko <yaroslav.miroshnychenko@sonymobile.com>
Date: Thu, 14 Jun 2012 12:41:54 +0200
Subject: [PATCH] Add missing va_end() to prevent stack corruptions

Added va_end() for copied variable arguments lists
in __vfprintf() and __find_arguments().
This is by C standard.
Important for systems which pass arguments in registers.

Change-Id: I7ac42beaa6645bfe856c18132253352dae29ea37
---
 libc/stdio/vfprintf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c
index dac8496ca..83e69ef86 100644
--- a/libc/stdio/vfprintf.c
+++ b/libc/stdio/vfprintf.c
@@ -827,6 +827,7 @@ error:
 		munmap(argtable, argtablesiz);
 		argtable = NULL;
 	}
+        va_end(orgap);
 	return (__sferror(fp) ? EOF : ret);
 	/* NOTREACHED */
 }