From f29275ced282e4ab8c5435b1ec25cbae0fdc2853 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Fri, 28 Jun 2024 14:27:09 -0400 Subject: [PATCH] ipc: return NULL in ipc_client_system_create if call to systep properties fails Part-of: --- src/xrt/ipc/client/ipc_client_system.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xrt/ipc/client/ipc_client_system.c b/src/xrt/ipc/client/ipc_client_system.c index d21494cec..3ec5f8ef1 100644 --- a/src/xrt/ipc/client/ipc_client_system.c +++ b/src/xrt/ipc/client/ipc_client_system.c @@ -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;