From e95e19a3ea19d72c6b3134df05b4c9b596e7c80e Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Thu, 20 Jul 2017 03:49:31 -0700 Subject: [PATCH] Avoid freeing static strings --- src/mbpfan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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++) {