You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gopsutil/sensors
Li Chuangbo 19082b35ae
fix: memory leak and string corruption in ARM Mac temperature sensors
This commit addresses several issues in the temperature sensor implementation for ARM Mac:
1. Memory leak caused by unreleased system resources
2. Increasing port counts in Activity Monitor
3. String corruption where the first character becomes "\x00"

Changes:

1. Resource Management:
   - Added proper resource cleanup using `defer` statements
   - Refactored code to share the HID system client instead of creating new ones
   - Fixed memory leaks by ensuring all CoreFoundation objects are properly released

2. String Handling:
   - Fixed buffer allocation for string conversion
   - Properly handle null terminators in C string to Go string conversion
   - Added correct string length calculations

3. Code Structure:
   - Reduced resource allocation by sharing system client between functions
   - Enhanced code readability with better comments
4 months ago
..
ex_linux.go [sensors][linux]: add ExLinux on sensors. 12 months ago
sensors.go [sensors] move Temperatures from host to sensors. 12 months ago
sensors_aix.go fix: golangci lint with max -> maxConn 9 months ago
sensors_darwin.go feat(cpu, mem, sensors)(darwin): cgo-free implementations 8 months ago
sensors_darwin_arm64.go fix: memory leak and string corruption in ARM Mac temperature sensors 4 months ago
sensors_fallback.go [aix]: move tempereture from host to sensors package. 12 months ago
sensors_freebsd.go fix: typo in `sensors_freebsd` package name 11 months ago
sensors_linux.go Fix error message typo in sensors_linux 8 months ago
sensors_netbsd.go [sensors] move Temperatures from host to sensors. 12 months ago
sensors_openbsd.go fix golangcilint errors, ignore gosec G115 9 months ago
sensors_solaris.go [sensors] move Temperatures from host to sensors. 12 months ago
sensors_test.go [sensors] move Temperatures from host to sensors. 12 months ago
sensors_windows.go [sensors] move Temperatures from host to sensors. 12 months ago