add missing va_end in execl* for correcness and static code analyzers
authorSzabolcs Nagy <nsz@port70.net>
Mon, 7 Oct 2013 13:24:00 +0000 (13:24 +0000)
committerSzabolcs Nagy <nsz@port70.net>
Mon, 7 Oct 2013 13:24:00 +0000 (13:24 +0000)
src/process/execl.c
src/process/execle.c
src/process/execlp.c

index 327d78b288118b12cc85e0fb6839556f6a51d90e..5ee5c81e357c0756cb30bb4bb43c9adb6d35ae20 100644 (file)
@@ -16,6 +16,7 @@ int execl(const char *path, const char *argv0, ...)
                for (i=1; i<argc; i++)
                        argv[i] = va_arg(ap, char *);
                argv[i] = NULL;
+               va_end(ap);
                return execv(path, argv);
        }
 }
index 6f2ec055bf497ab26770fa44b5dfc6c539df81a8..37ca50349ac21db3d4789688046e31da0b16b57a 100644 (file)
@@ -17,6 +17,7 @@ int execle(const char *path, const char *argv0, ...)
                for (i=1; i<=argc; i++)
                        argv[i] = va_arg(ap, char *);
                envp = va_arg(ap, char **);
+               va_end(ap);
                return execve(path, argv, envp);
        }
 }
index c7b3f51389eba341edee086981a068e137f87b3b..5eed886e716fa9721bf953b877df19a89bd5718f 100644 (file)
@@ -16,6 +16,7 @@ int execlp(const char *file, const char *argv0, ...)
                for (i=1; i<argc; i++)
                        argv[i] = va_arg(ap, char *);
                argv[i] = NULL;
+               va_end(ap);
                return execvp(file, argv);
        }
 }