desktop-shell: fix invalid memory access when shell execution fails
authorArnaud Vrac <avrac@freebox.fr>
Mon, 25 Aug 2014 18:56:46 +0000 (20:56 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 27 Aug 2014 13:57:55 +0000 (16:57 +0300)
In this case wl_client_add_destroy_listener() was called with a NULL
client, which is invalid.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
desktop-shell/shell.c

index c8a9f01..5a60086 100644 (file)
@@ -5349,8 +5349,10 @@ launch_desktop_shell_process(void *data)
                                                 shell->client,
                                                 desktop_shell_sigchld);
 
-       if (!shell->child.client)
+       if (!shell->child.client) {
                weston_log("not able to start %s\n", shell->client);
+               return;
+       }
 
        shell->child.client_destroy_listener.notify =
                desktop_shell_client_destroy;