From bc076a67d2d2612517d41ba27ebbc692234f0a3b Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 25 Jul 2014 17:36:14 +0200 Subject: [PATCH] p2v: properly call va_end --- miniexpect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/miniexpect.c b/miniexpect.c index 99bd29a..e1a184c 100644 --- a/miniexpect.c +++ b/miniexpect.c @@ -114,6 +114,7 @@ mexp_spawnl (const char *file, const char *arg, ...) new_argv = realloc (argv, sizeof (char *) * (i+1)); if (new_argv == NULL) { free (argv); + va_end (args); return NULL; } argv = new_argv; @@ -122,6 +123,7 @@ mexp_spawnl (const char *file, const char *arg, ...) h = mexp_spawnv (file, argv); free (argv); + va_end (args); return h; } -- 1.8.3.1