cu_mount_checkoption() behaves a bit like strstr() in that it returns a pointer
into the buffer. cu_mount_getoptionvalue() allocated memory that was never
freed, slowly leaking memory (although very little).
Github: #412
{
/* Find the cgroup mountpoint which contains the cpuacct
* controller. */
- if (strcmp(mnt_ptr->type, "cgroup") != 0 ||
- !cu_mount_getoptionvalue(mnt_ptr->options, "cpuacct"))
+ if ((strcmp(mnt_ptr->type, "cgroup") != 0)
+ || !cu_mount_checkoption(mnt_ptr->options,
+ "cpuacct", /* full = */ 1))
continue;
walk_directory (mnt_ptr->dir, read_cpuacct_root,