]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables: Coverity: VARARGS
authorJiri Popelka <jpopelka@redhat.com>
Fri, 10 Jun 2011 13:26:00 +0000 (15:26 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Wed, 22 Jun 2011 13:59:27 +0000 (15:59 +0200)
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>
iptables/xtables.c

index acfcf8bd600fa9620059830c70c87904695041c9..db6d079f1220620f405cac53da8bb6905bb71fbe 100644 (file)
@@ -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;