mirror of
https://gitlab.com/procps-ng/procps.git
synced 2024-11-23 01:53:39 +08:00
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:
parent
241cb88542
commit
f471650dc5
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user