From: Eduardo Lima (Etrunko) <eblima(a)br.ibm.com>
As revealed by Coverity scan report:
https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8
https://bugzilla.redhat.com/attachment.cgi?id=530435
Error: REVERSE_INULL:
acl_parsing.c:172: deref_ptr: Directly dereferencing pointer "filters".
acl_parsing.c:174: check_after_deref: Dereferencing "filters" before a null
check.
Signed-off-by: Eduardo Lima (Etrunko) <eblima(a)br.ibm.com>
---
libxkutil/acl_parsing.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/libxkutil/acl_parsing.c b/libxkutil/acl_parsing.c
index 935e642..7cde1f0 100644
--- a/libxkutil/acl_parsing.c
+++ b/libxkutil/acl_parsing.c
@@ -151,11 +151,13 @@ void cleanup_filter(struct acl_filter *filter)
void cleanup_filters(struct acl_filter **filters, int count)
{
int i;
- struct acl_filter *_filters = *filters;
+ struct acl_filter *_filters;
if((filters == NULL) || (*filters == NULL) || (count == 0))
return;
+ _filters = *filters;
+
for (i = 0; i < count; i++)
cleanup_filter(&_filters[i]);
--
1.7.4.4