summaryrefslogtreecommitdiffstats
path: root/iptables
diff options
context:
space:
mode:
authorJiri Popelka <jpopelka@redhat.com>2011-06-10 15:26:00 +0200
committerJan Engelhardt <jengelh@medozas.de>2011-06-22 15:59:27 +0200
commitd0101690d9ae347d8a8ee9e340c5db72480046a3 (patch)
treed72e3c9160ef6dfa955e732b09065dae4feba977 /iptables
parentee80faf4438102395bc4034894b6468453181be9 (diff)
iptables: Coverity: VARARGS
xtables.c:931: va_init: Initializing va_list "args". xtables.c:938: missing_va_end: va_end was not called for "args". xtables.c:947: missing_va_end: va_end was not called for "args". xtables.c:961: missing_va_end: va_end was not called for "args". Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'iptables')
-rw-r--r--iptables/xtables.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/iptables/xtables.c b/iptables/xtables.c
index acfcf8bd..db6d079f 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -1042,8 +1042,10 @@ void xtables_param_act(unsigned int status, const char *p1, ...)
case XTF_ONLY_ONCE:
p2 = va_arg(args, const char *);
b = va_arg(args, unsigned int);
- if (!b)
+ if (!b) {
+ va_end(args);
return;
+ }
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: \"%s\" option may only be specified once",
p1, p2);
@@ -1051,8 +1053,10 @@ void xtables_param_act(unsigned int status, const char *p1, ...)
case XTF_NO_INVERT:
p2 = va_arg(args, const char *);
b = va_arg(args, unsigned int);
- if (!b)
+ if (!b) {
+ va_end(args);
return;
+ }
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: \"%s\" option cannot be inverted", p1, p2);
break;
@@ -1065,8 +1069,10 @@ void xtables_param_act(unsigned int status, const char *p1, ...)
break;
case XTF_ONE_ACTION:
b = va_arg(args, unsigned int);
- if (!b)
+ if (!b) {
+ va_end(args);
return;
+ }
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: At most one action is possible", p1);
break;