Commit 7614ae53 authored by Hannes Domani's avatar Hannes Domani Committed by Jean-Baptiste Kempf

Direct3D: fix memory leak

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
(cherry picked from commit 9ac30b31fc91e5a47135c1ca2f9c08ea0f5c255d)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent a15bef7c
......@@ -511,11 +511,9 @@ static HINSTANCE Direct3DLoadShaderLibrary(void)
{
HINSTANCE instance = NULL;
for (int i = 43; i > 23; --i) {
char *filename = NULL;
if (asprintf(&filename, "D3dx9_%d.dll", i) == -1)
continue;
instance = LoadLibrary(ToT(filename));
free(filename);
TCHAR filename[16];
_sntprintf(filename, 16, TEXT("D3dx9_%d.dll"), i);
instance = LoadLibrary(filename);
if (instance)
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment