mbpfan-josie

Address Valgrind warnings during unit tests

110ccb58144d1808f2200aef17b12a19a18a86cd
Andrew Gaul <andrew@gaul.org> · 2019-10-30T16:04 · browse files at this commit

parents: abda2b8

diff --git a/src/minunit.c b/src/minunit.c
index 2818b50..e59b3a3 100644
--- a/src/minunit.c
+++ b/src/minunit.c
@@ -146,6 +146,7 @@ static const char *test_settings()
     t_fans* fan2 = (t_fans *)malloc(sizeof(t_fans));
     fan2->fan_id = 2;
     fan2->fan_max_speed = -1;
+    fan2->next = NULL;
     fan->next = fan2;
 
     retrieve_settings("./mbpfan.conf.test2", fan);
@@ -194,6 +195,7 @@ static const char *test_settings_reload()
 {
     t_fans* fan = (t_fans *) malloc( sizeof( t_fans ) );
     fan->fan_id = 1;
+    fan->fan_min_speed = -1;
     fan->next = NULL;
 
     signal(SIGHUP, handler);