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:
emellor@ewan committed 2005-09-21 11:24:26 +01:00
1 parent 0a8fb66792
commit 7bfeb73ad7
1 file changed
+4 -1
+4 -1
View File
@@ -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++ )
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.