debuggers.hg
changeset 7015:1196da5782bf
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>
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>
author | emellor@ewan |
---|---|
date | Wed Sep 21 11:24:26 2005 +0100 (2005-09-21) |
parents | a35c20d53947 |
children | ba10ee566ab7 |
files | tools/python/xen/lowlevel/xc/xc.c |
line diff
1.1 --- a/tools/python/xen/lowlevel/xc/xc.c Tue Sep 20 17:31:22 2005 +0100 1.2 +++ b/tools/python/xen/lowlevel/xc/xc.c Wed Sep 21 11:24:26 2005 +0100 1.3 @@ -222,8 +222,11 @@ static PyObject *pyxc_domain_getinfo(PyO 1.4 nr_doms = xc_domain_getinfo(xc->xc_handle, first_dom, max_doms, info); 1.5 1.6 if (nr_doms < 0) 1.7 + { 1.8 + free(info); 1.9 return PyErr_SetFromErrno(xc_error); 1.10 - 1.11 + } 1.12 + 1.13 list = PyList_New(nr_doms); 1.14 for ( i = 0 ; i < nr_doms; i++ ) 1.15 {