Created attachment 210310 [details] patch to free freqstr if sysctl fails In the event that the (second) sysctl fails in read_freqs(), the memory allocated for freqstr is not freed before the function returns. I've attached a patch to free the allocated memory before the function returns.
A commit references this bug: Author: markj Date: Sun Dec 29 20:57:49 UTC 2019 New revision: 356184 URL: https://svnweb.freebsd.org/changeset/base/356184 Log: powerd(8): Fix a memory leak when we fail to read frequency levels. PR: 242967 Submitted by: Hans Christian Woithe <chwoithe@yahoo.com> MFC after: 3 days Changes: head/usr.sbin/powerd/powerd.c
A commit references this bug: Author: markj Date: Thu Jan 2 14:39:37 UTC 2020 New revision: 356272 URL: https://svnweb.freebsd.org/changeset/base/356272 Log: MFC r356184: powerd(8): Fix a memory leak when we fail to read frequency levels. PR: 242967 Changes: _U stable/12/ stable/12/usr.sbin/powerd/powerd.c
Thanks for the patch.