[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[virt-tools-list] [PATCH 11/11] avoid legitimate gcc used-before-set warning



From: Jim Meyering <meyering redhat com>

* test/test-filter.c (main): Initialize filter buffer before
trying to free it.
---
 test/test-filter.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/test/test-filter.c b/test/test-filter.c
index dc3eaee..55eb2fd 100644
--- a/test/test-filter.c
+++ b/test/test-filter.c
@@ -30,6 +30,7 @@ int main(int argc, char** argv)

     /* Ensure that freeing an uninitialized filter is invalid */
     printf("Checking that freeing unitialized filter is invalid...\n");
+    memset (&filter, sizeof filter, 0);
     ret = osi_free_filter(filter);
     assert ( ret != 0 );

-- 
1.7.0.rc0.187.g226c


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]