ipc: return NULL in ipc_client_system_create if call to systep properties fails

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2140>
This commit is contained in:
Simon Zeni 2024-06-28 14:27:09 -04:00
parent b016b062b0
commit f29275ced2

View file

@ -136,7 +136,11 @@ ipc_client_system_create(struct ipc_connection *ipc_c, struct xrt_system_composi
{
struct ipc_client_system *icsys = U_TYPED_CALLOC(struct ipc_client_system);
xrt_result_t xret = ipc_call_system_get_properties(ipc_c, &icsys->base.properties);
assert(xret == XRT_SUCCESS);
if (xret != XRT_SUCCESS) {
free(icsys);
return NULL;
}
icsys->base.create_session = ipc_client_system_create_session;
icsys->base.destroy = ipc_client_system_destroy;
icsys->ipc_c = ipc_c;