mbpfan-josie

Plug little leak

Found via Valgrind.

c8f33ec05519fab120c3d66b81cd8ae255bd2d37
Andrew Gaul <andrew@gaul.org> · 2019-01-15T15:44 · browse files at this commit

parents: 968133e

diff --git a/src/mbpfan.c b/src/mbpfan.c
index 27c63e8..4832099 100644
--- a/src/mbpfan.c
+++ b/src/mbpfan.c
@@ -163,6 +163,9 @@ t_sensors *retrieve_sensors()
 	int processor;
 	for (processor = 0; processor < NUM_PROCESSORS; processor++) {
 
+	    if (path_begin != NULL) {
+	        free(path_begin);
+	    }
 	    path_begin = smprintf("/sys/devices/platform/coretemp.%d/hwmon/hwmon", processor);
 
 	    int counter;