Patch pulled from https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/powertop&id=37469c47b885c50365f57044e4ad72e0e3512b91 Fixes a use-after-close bug in create_all_devfreq_devices(). Signed-off-by: Steven Noonan --- a/src/devices/devfreq.cpp +++ b/src/devices/devfreq.cpp @@ -247,6 +247,7 @@ void create_all_devfreq_devices(void) fprintf(stderr, "Devfreq not enabled\n"); is_enabled = false; closedir(dir); + dir = NULL; return; }