Ver código fonte

Fix potential memory leak in game_mode_initialise_gpu

Marc Di Luzio 5 anos atrás
pai
commit
9db7442a31
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      daemon/gamemode-gpu.c

+ 1 - 0
daemon/gamemode-gpu.c

@@ -84,6 +84,7 @@ int game_mode_initialise_gpu(GameModeConfig *config, GameModeGPUInfo **info)
 	new_info->vendor = gamemode_get_gpu_vendor(new_info->device);
 	if (!GPUVendorValid(new_info->vendor)) {
 		LOG_ERROR("Found invalid vendor, will not apply optimisations!\n");
+		free(new_info);
 		return -1;
 	}