mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
admin_server: Avoid accessing unallocated memory
In 68b726b93c
we tried to fix a mem leak. However, it
wasn't done quite well. Problem is, virNetDaemonGetServers() may
fail in which case virObjectListFreeCount() would be called with
-1 objects to free. But the number of elements is taken in
unsigned rather than signed integer.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
3e5b35a538
commit
d715bfac08
@ -54,7 +54,8 @@ adminConnectListServers(virNetDaemonPtr dmn,
|
|||||||
srvs = NULL;
|
srvs = NULL;
|
||||||
}
|
}
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectListFreeCount(srvs, ret);
|
if (ret > 0)
|
||||||
|
virObjectListFreeCount(srvs, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user