clients: Fix null dereferencing 11/282511/1
authorduna.oh <duna.oh@samsung.com>
Tue, 4 Oct 2022 03:35:07 +0000 (12:35 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 5 Oct 2022 01:11:40 +0000 (10:11 +0900)
Change-Id: I5bf4aaa0c28e552d1377585a6cc570e1ab376305

clients/simple-shm-shell.c

index 2ca0717..9621027 100644 (file)
@@ -206,9 +206,11 @@ handle_global(void *data, struct wl_registry *registry, uint32_t name,
                        printf("%s(%d): bind %s.\n", __func__, __LINE__, interface);
        } else if (strcmp(interface, "wl_shm") == 0) {
                ti->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
-               if (!ti->shm)
+               if (!ti->shm) {
                        printf("%s(%d): Error. fail to bind  %s.\n",
                                        __func__, __LINE__, interface);
+                       return;
+               }
                else
                        printf("%s(%d): bind %s.\n", __func__, __LINE__, interface);