From 0d2e33ded529d216bb5914887b2384e765e3eae7 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 27 Oct 2023 16:16:19 +0300 Subject: grpc-proxy/main-grpc: Don't fall trough assuming we have a wl_display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Maybe the third time is a charm to avoid fall through and assume on the exit path we do have a wl_display. Bug-AGL: SPEC-4935 Reported-by: Lisandro Pérez Meyer Tested-by: Lisandro Pérez Meyer Signed-off-by: Marius Vlad Change-Id: I4adef5bf72d6b1a32a218bf1cfa6c8ed4450ba48 --- grpc-proxy/main-grpc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'grpc-proxy') diff --git a/grpc-proxy/main-grpc.cpp b/grpc-proxy/main-grpc.cpp index a8c1c5e..5569fc8 100644 --- a/grpc-proxy/main-grpc.cpp +++ b/grpc-proxy/main-grpc.cpp @@ -387,7 +387,8 @@ __register_shell_init(void) wl_display = wl_display_connect(NULL); if (!wl_display) { - goto err; + ret = -1; + goto err_failed_display; } registry = wl_display_get_registry(wl_display); sh->wait_for_bound = true; @@ -416,6 +417,8 @@ __register_shell_init(void) err: wl_registry_destroy(registry); wl_display_disconnect(wl_display); + +err_failed_display: delete sh; return ret; } -- cgit 1.2.3-korg