From 5195e2c34c33cc81fb4ca1995decf1b7dc863aab Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Mon, 10 Dec 2012 13:29:01 +0100 Subject: Fix va_end() missing calls A few va_start() calls aren't followed by their corresponding va_end(). This patch adds the missing va_end() calls. Signed-off-by: Guillaume Nault --- accel-pppd/cli/cli.c | 2 ++ accel-pppd/pwdb.c | 6 ++++-- accel-pppd/triton/log.c | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/accel-pppd/cli/cli.c b/accel-pppd/cli/cli.c index 917634c9..90341cd3 100644 --- a/accel-pppd/cli/cli.c +++ b/accel-pppd/cli/cli.c @@ -54,6 +54,8 @@ void __export cli_register_simple_cmd2( c->hdr[i] = va_arg(ap, char *); list_add_tail(&c->entry, &simple_cmd_list); + + va_end(ap); } void __export cli_register_regexp_cmd(struct cli_regexp_cmd_t *cmd) diff --git a/accel-pppd/pwdb.c b/accel-pppd/pwdb.c index 4c0ab02e..ec1b7d10 100644 --- a/accel-pppd/pwdb.c +++ b/accel-pppd/pwdb.c @@ -22,11 +22,13 @@ int __export pwdb_check(struct ppp_t *ppp, const char *username, int type, ...) r = pwdb->check(pwdb, ppp, username, type, args); if (r == PWDB_NO_IMPL) continue; - if (r == PWDB_SUCCESS) - return PWDB_SUCCESS; res = r; + if (r == PWDB_SUCCESS) + break; } + va_end(args); + return res; } __export char *pwdb_get_passwd(struct ppp_t *ppp, const char *username) diff --git a/accel-pppd/triton/log.c b/accel-pppd/triton/log.c index 95304284..9226e117 100644 --- a/accel-pppd/triton/log.c +++ b/accel-pppd/triton/log.c @@ -59,6 +59,7 @@ void triton_log_error(const char *fmt,...) va_start(ap, fmt); do_log(f_error, fmt, ap); + va_end(ap); } void triton_log_debug(const char *fmt,...) @@ -70,5 +71,6 @@ void triton_log_debug(const char *fmt,...) va_start(ap, fmt); do_log(f_debug, fmt, ap); + va_end(ap); } -- cgit v1.2.3