mbpfan-josie

Avoid freeing static strings

e95e19a3ea19d72c6b3134df05b4c9b596e7c80e
Andrew Gaul <andrew@gaul.org> · 2017-07-20T03:49 · browse files at this commit

parents: f1bdb61

diff --git a/src/mbpfan.c b/src/mbpfan.c
index ecd4969..3d0b3da 100644
--- a/src/mbpfan.c
+++ b/src/mbpfan.c
@@ -121,7 +121,7 @@ t_sensors *retrieve_sensors()
             }
         }
 
-        path_begin = (char *) "/sys/devices/platform/coretemp.0/temp";
+        path_begin = strdup("/sys/devices/platform/coretemp.0/temp");
 
     } else {
 
@@ -133,7 +133,7 @@ t_sensors *retrieve_sensors()
             }
         }
 
-        path_begin = (char *) "/sys/devices/platform/coretemp.0/hwmon/hwmon";
+        path_begin = strdup("/sys/devices/platform/coretemp.0/hwmon/hwmon");
 
         int counter;
         for (counter = 0; counter < 10; counter++) {