mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
tools: Fix a few error-path memory leaks.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
1 parent
b90edb337d
commit
6ac1537ba7
3 files changed
+10
-4
No files matched your search
@@ -68,6 +68,8 @@ static void *__getssid(int domid, uint32_t *buflen)
|
||||
goto out2;
|
||||
} else {
|
||||
*buflen = SSID_BUFFER_SIZE;
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
goto out2;
|
||||
}
|
||||
out2:
|
||||
|
||||
@@ -55,6 +55,7 @@ static PyObject *pyflask_context_to_sid(PyObject *self, PyObject *args,
|
||||
xc_handle = xc_interface_open();
|
||||
if (xc_handle < 0) {
|
||||
errno = xc_handle;
|
||||
free(buf);
|
||||
return PyErr_SetFromErrno(xc_error_obj);
|
||||
}
|
||||
|
||||
|
||||
@@ -678,19 +678,22 @@ static PyObject *pyxc_get_device_group(XcObject *self,
|
||||
|
||||
if ( rc < 0 )
|
||||
{
|
||||
free(sdev_array);
|
||||
return pyxc_error_to_exception();
|
||||
free(sdev_array);
|
||||
return pyxc_error_to_exception();
|
||||
}
|
||||
|
||||
if ( !num_sdevs )
|
||||
{
|
||||
free(sdev_array);
|
||||
return Py_BuildValue("s", "");
|
||||
free(sdev_array);
|
||||
return Py_BuildValue("s", "");
|
||||
}
|
||||
|
||||
group_str = calloc(num_sdevs, sizeof(dev_str));
|
||||
if (group_str == NULL)
|
||||
{
|
||||
free(sdev_array);
|
||||
return PyErr_NoMemory();
|
||||
}
|
||||
|
||||
for ( i = 0; i < num_sdevs; i++ )
|
||||
{
|
||||
|
||||