From 9bcdda7b5268c1d6468c6674367892835864210f Mon Sep 17 00:00:00 2001 From: Jim Huang Date: Fri, 22 Dec 2017 04:28:18 +0800 Subject: [PATCH] pdclib: va_list 'ap' was opened but not closed by va_end() --- pdclib/functions/_PDCLIB/stdarg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pdclib/functions/_PDCLIB/stdarg.c b/pdclib/functions/_PDCLIB/stdarg.c index 9e43be6..97ac7e9 100644 --- a/pdclib/functions/_PDCLIB/stdarg.c +++ b/pdclib/functions/_PDCLIB/stdarg.c @@ -92,11 +92,14 @@ static int test( enum tag_t s, ... ) } case TAG_END: { - va_end( ap ); - return 0; + goto cleanup; } } } + +cleanup: + va_end( ap ); + return 0; } int main( void )