From: Ian Jackson Date: Tue, 22 Jun 2010 15:00:08 +0000 (+0100) Subject: python/xc: do not crash xend if /proc/xen/privcmd cannot be opened X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11889^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b9ae83b6e2a50a21a6fe16273218e3403d053fc7;p=xen.git 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 --- diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index a7286c4e85..13704249b5 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -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 ) {