Explorar o código

gamemode: Never add NULL to the client list

When running wine games, there's good chance the executable is already
gone when GameMode decided to add it to the list. Let's silently bail
out here. It probably grabs a non-matching PID anyway in this moment.

Signed-off-by: Kai Krakow <kai@kaishome.de>
Kai Krakow %!s(int64=6) %!d(string=hai) anos
pai
achega
2a0c6e7098
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      daemon/gamemode.c

+ 2 - 0
daemon/gamemode.c

@@ -455,6 +455,8 @@ bool game_mode_context_register(GameModeContext *self, pid_t client)
 		return false;
 	}
 	cl->executable = game_mode_context_find_exe(client);
+	if (!cl->executable)
+		goto error_cleanup;
 
 	if (game_mode_context_has_client(self, client)) {
 		LOG_ERROR("Addition requested for already known process [%d]\n", client);