BUG/MINOR: contrib/mod_defender: close the va_list argp before return

Fix the case when the va_list argp could be left open if the function
vsnprintf() returned a negative value.
This commit is contained in:
Dragan Dosen 2017-09-18 08:20:33 +02:00 committed by Willy Tarreau
parent f8bb0ce450
commit ccf6100e11
1 changed files with 2 additions and 1 deletions

View File

@ -149,9 +149,10 @@ static char *defender_printf(apr_pool_t *pool, const char *fmt, ...)
va_start(argp, fmt);
len = vsnprintf(NULL, 0, fmt, argp);
va_end(argp);
if (len < 0)
return NULL;
va_end(argp);
if (!(dst = apr_pcalloc(pool, len + 1)))
return NULL;