mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
On one of pyxc_domain_getinfo's error paths, free the block allocated
previously. This would have caused a memory leak when attempting to get info on a domain that does not exist. Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
0a8fb66792
commit
7bfeb73ad7
1 file changed
+4
-1
@@ -222,8 +222,11 @@ static PyObject *pyxc_domain_getinfo(PyObject *self,
|
||||
nr_doms = xc_domain_getinfo(xc->xc_handle, first_dom, max_doms, info);
|
||||
|
||||
if (nr_doms < 0)
|
||||
{
|
||||
free(info);
|
||||
return PyErr_SetFromErrno(xc_error);
|
||||
|
||||
}
|
||||
|
||||
list = PyList_New(nr_doms);
|
||||
for ( i = 0 ; i < nr_doms; i++ )
|
||||
{
|
||||
|
||||