mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
util: Fix possible NULL dereference
Commit 1a80b97d, which added the virCgroupHasEmptyTasks() function forgot that the parameter @cgroup may be NULL and did not check that. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
f5070e3ad0
commit
3b0f05573f
@ -3932,6 +3932,9 @@ virCgroupHasEmptyTasks(virCgroupPtr cgroup, int controller)
|
||||
int ret = -1;
|
||||
char *content = NULL;
|
||||
|
||||
if (!cgroup)
|
||||
return -1;
|
||||
|
||||
ret = virCgroupGetValueStr(cgroup, controller, "tasks", &content);
|
||||
|
||||
if (ret == 0 && content[0] == '\0')
|
||||
|
Loading…
x
Reference in New Issue
Block a user