libxc: Fix Segmentation fault of xend

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:
Keir Fraser committed 2010-06-21 09:55:12 +01:00
1 parent 636fed5063
commit ff4cc39490
1 file changed
+4 -2
+4 -2
View File
@@ -82,8 +82,10 @@ const xc_error *xc_get_last_error(xc_interface *xch)
void xc_clear_last_error(xc_interface *xch)
{
xch->last_error.code = XC_ERROR_NONE;
xch->last_error.message[0] = '\0';
if (xch) {
xch->last_error.code = XC_ERROR_NONE;
xch->last_error.message[0] = '\0';
}
}
const char *xc_error_code_to_desc(int code)
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.