tools: Fix a few error-path memory leaks.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
Keir Fraser committed 2008-12-09 12:53:19 +00:00
1 parent b90edb337d
commit 6ac1537ba7
3 files changed
+10 -4

No files matched your search

+2
View File
@@ -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:
+1
View File
@@ -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);
}
+7 -4
View File
@@ -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++ )
{
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.