It seems that on Fedora systems, probably due to some hardening features, memory malloc-ed by the getline() call when trying to parse the file (when the cgroup root path is in auto mode) is improperly handled after the clone call. Instead of directly setting the pointer to that memory, using strdup again seems to do the trick and properly allocate memory just for the string.
In addition, this makes the setup of the cf_cg_root variable consistent with config.c, in which it is also strdup-ed in the cf_string function.
It seems that on Fedora systems, probably due to some hardening features, memory
malloc
-ed by thegetline()
call when trying to parse the file (when the cgroup root path is in auto mode) is improperly handled after the clone call. Instead of directly setting the pointer to that memory, usingstrdup
again seems to do the trick and properly allocate memory just for the string.In addition, this makes the setup of the cf_cg_root variable consistent with config.c, in which it is also strdup-ed in the
cf_string
function.If accepted, this pull request can close #142.