Skip to content

Commit c8f33ec

Browse files
committed
Plug little leak
Found via Valgrind.
1 parent 968133e commit c8f33ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mbpfan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ t_sensors *retrieve_sensors()
163163
int processor;
164164
for (processor = 0; processor < NUM_PROCESSORS; processor++) {
165165

166+
if (path_begin != NULL) {
167+
free(path_begin);
168+
}
166169
path_begin = smprintf("/sys/devices/platform/coretemp.%d/hwmon/hwmon", processor);
167170

168171
int counter;

0 commit comments

Comments
 (0)