mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
6f4e9be827
commit
b9ae83b6e2
1 file changed
+2
-1
@@ -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 )
|
||||
{
|
||||
|
||||