python/xc: do not crash xend if /proc/xen/privcmd cannot be opened

If /proc/xen/privcmd cannot be opened,
start xend occurs Segmentation fault.
Add check to fix it.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
This commit is contained in:
Ian Jackson committed 2010-06-22 16:00:08 +01:00
1 parent 6f4e9be827
commit b9ae83b6e2
1 file changed
+2 -1
+2 -1
View File
@@ -72,7 +72,8 @@ static PyObject *pyxc_error_to_exception(xc_interface *xch)
else
pyerr = Py_BuildValue("(is)", err->code, desc);
xc_clear_last_error(xch);
if (xch)
xc_clear_last_error(xch);
if ( pyerr != NULL )
{
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.