library: Fix memory leak in procps_users

Need to free the sesions_list after using it, this was
introduced by me when checking the session class.

Thanks to Thorsten Kukuk from SUSE (All capitals)
for catching this and the patch.

References:
 commit 734930e476
 https://www.freelists.org/post/procps/New-procps-release-soon,10

Signed-off-by: Craig Small <csmall@dropbear.xyz>
This commit is contained in:
Craig Small 2024-10-03 19:13:58 +10:00
parent 241cb88542
commit f471650dc5

View File

@ -91,6 +91,9 @@ PROCPS_EXPORT int procps_users(void)
numuser++;
free(class);
}
for (i = 0; i < sessions; i++)
free(sessions_list[i]);
free(sessions_list);
return numuser;
}
}