From: Jiri Popelka <jpopelka@redhat.com>
To: netfilter-devel@vger.kernel.org
Cc: Jiri Popelka <jpopelka@redhat.com>
Subject: [PATCH 4/8] iptables: Coverity: REVERSE_INULL
Date: Fri, 10 Jun 2011 15:25:58 +0200 [thread overview]
Message-ID: <1307712362-17727-5-git-send-email-jpopelka@redhat.com> (raw)
In-Reply-To: <1307712362-17727-1-git-send-email-jpopelka@redhat.com>
ip6tables-restore.c:186: deref_ptr_in_call: Dereferencing pointer "in".
ip6tables-restore.c:463: check_after_deref: Dereferencing "in" before a null check.
iptables-restore.c:192: deref_ptr_in_call: Dereferencing pointer "in".
iptables-restore.c:468: check_after_deref: Dereferencing "in" before a null check.
iptables-xml.c:671: deref_ptr_in_call: Dereferencing pointer "in".
iptables-xml.c:873: check_after_deref: Dereferencing "in" before a null check.
---
iptables/ip6tables-restore.c | 3 +--
iptables/iptables-restore.c | 3 +--
iptables/iptables-xml.c | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/iptables/ip6tables-restore.c b/iptables/ip6tables-restore.c
index 420bc52..ae147d5 100644
--- a/iptables/ip6tables-restore.c
+++ b/iptables/ip6tables-restore.c
@@ -460,7 +460,6 @@ int main(int argc, char *argv[])
exit(1);
}
- if (in != NULL)
- fclose(in);
+ fclose(in);
return 0;
}
diff --git a/iptables/iptables-restore.c b/iptables/iptables-restore.c
index 2624599..1cb833c 100644
--- a/iptables/iptables-restore.c
+++ b/iptables/iptables-restore.c
@@ -465,7 +465,6 @@ main(int argc, char *argv[])
exit(1);
}
- if (in != NULL)
- fclose(in);
+ fclose(in);
return 0;
}
diff --git a/iptables/iptables-xml.c b/iptables/iptables-xml.c
index e2cb809..f340889 100644
--- a/iptables/iptables-xml.c
+++ b/iptables/iptables-xml.c
@@ -866,8 +866,7 @@ main(int argc, char *argv[])
exit(1);
}
- if (in != NULL)
- fclose(in);
+ fclose(in);
printf("</iptables-rules>\n");
free_argv();
--
1.7.5.2
next prev parent reply other threads:[~2011-06-10 13:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-10 13:25 [PATCH 0/8] Possible problems found by static analysis of code Jiri Popelka
2011-06-10 13:25 ` [PATCH 1/8] iptables: Coverity: DEADCODE Jiri Popelka
2011-06-22 13:49 ` Jan Engelhardt
2011-06-10 13:25 ` [PATCH 2/8] iptables: Coverity: FORWARD_NULL Jiri Popelka
2011-06-10 13:25 ` [PATCH 3/8] iptables: Coverity: NEGATIVE_RETURNS Jiri Popelka
2011-06-22 13:55 ` Jan Engelhardt
2011-06-10 13:25 ` Jiri Popelka [this message]
2011-06-22 13:58 ` [PATCH 4/8] iptables: Coverity: REVERSE_INULL Jan Engelhardt
2011-06-10 13:25 ` [PATCH 5/8] iptables: Coverity: UNINIT Jiri Popelka
2011-06-10 13:26 ` [PATCH 6/8] iptables: Coverity: VARARGS Jiri Popelka
2011-06-22 13:59 ` Jan Engelhardt
2011-06-10 13:26 ` [PATCH 7/8] iptables: Coverity: OVERRUN_STATIC Jiri Popelka
2011-06-10 21:10 ` Jan Engelhardt
2011-06-10 13:26 ` [PATCH 8/8] iptables: Coverity: RESOURCE_LEAK Jiri Popelka
2011-06-22 16:09 ` Jan Engelhardt
2011-06-10 16:04 ` [PATCH 0/8] Possible problems found by static analysis of code Pablo Neira Ayuso
2011-06-11 13:40 ` Jozsef Kadlecsik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1307712362-17727-5-git-send-email-jpopelka@redhat.com \
--to=jpopelka@redhat.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).