summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-05-04 15:38:28 +0200
committerThomas Haller <thaller@redhat.com>2015-05-13 14:31:05 +0200
commit4bdd83127d28f422d23b15ef0ccb65522c7e2b0c (patch)
tree802ee7b4507470927b541963eb4a730bb6724436
parentd8d0c481b8d1ad5e9599994c5e8f8fa83657ce5c (diff)
downloadNetworkManager-4bdd83127d28f422d23b15ef0ccb65522c7e2b0c.tar.gz
route-manager/test: fix missing initialization of temporary variables on stack
Up to now, this code was correct. Later we will add another field to NMPlatformIP4Route which causes the test to operate on uninitialized data. Instead of explicitly initializing the field, just clear the whole struct.
-rw-r--r--src/tests/test-route-manager.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/test-route-manager.c b/src/tests/test-route-manager.c
index f7b37a3b4a..c7b60e68e0 100644
--- a/src/tests/test-route-manager.c
+++ b/src/tests/test-route-manager.c
@@ -39,7 +39,7 @@ static void
setup_dev0_ip4 (int ifindex, guint mss_of_first_route, guint32 metric_of_second_route)
{
GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route));
- NMPlatformIP4Route route;
+ NMPlatformIP4Route route = { 0 };
route.ifindex = ifindex;
route.mss = 0;
@@ -68,7 +68,7 @@ static void
setup_dev1_ip4 (int ifindex)
{
GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route));
- NMPlatformIP4Route route;
+ NMPlatformIP4Route route = { 0 };
route.ifindex = ifindex;
route.mss = 0;
@@ -114,7 +114,7 @@ static void
update_dev0_ip4 (int ifindex)
{
GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route));
- NMPlatformIP4Route route;
+ NMPlatformIP4Route route = { 0 };
route.ifindex = ifindex;
route.mss = 0;