diff --git a/src/freebsd.cc b/src/freebsd.cc index e4eb3729..f39ace54 100644 --- a/src/freebsd.cc +++ b/src/freebsd.cc @@ -544,15 +544,13 @@ void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size) { char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_format, int divisor, unsigned int cpu) { int freq; - char *freq_sysctl; + char freq_sysctl[16] = {0}; if (!p_client_buffer || client_buffer_size <= 0 || !p_format || divisor <= 0) { return 0; } - char freq_sysctl[16] = {0}; - snprintf(freq_sysctl, sizeof(freq_sysctl), "dev.cpu.%d.freq", (cpu - 1)); if (GETSYSCTL(freq_sysctl, freq) == 0) {