[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: [PATCH] d3dx9_36/tests: Fix a memory leak in test_createtext.
From: Matteo Bruni <matteo.mystral () gmail ! com>
Date: 2017-02-28 15:21:51
Message-ID: CABvNrtNKsO7LVOvAiMuo7Gw4i7_1MHFvQ8uJbOr30U53XpdJbw () mail ! gmail ! com
[Download RAW message or body]
2017-02-27 7:52 GMT+01:00 Alex Henrie <alexhenrie24@gmail.com>:
> diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
> index 95dd06e466..64b7b8823c 100644
> --- a/dlls/d3dx9_36/tests/mesh.c
> +++ b/dlls/d3dx9_36/tests/mesh.c
> @@ -4340,8 +4340,7 @@ static void test_createtext(IDirect3DDevice9 *device, HDC hdc, const char *text,
> if (!compute_text_mesh(&mesh, text, deviation, extrusion, otm.otmEMSquare, glyphs))
> {
> skip("Couldn't create mesh\n");
> - d3dxmesh->lpVtbl->Release(d3dxmesh);
> - return;
> + goto error;
> }
> mesh.fvf = D3DFVF_XYZ | D3DFVF_NORMAL;
I would go in the other direction and strip all the error checking
branches and gotos from those tests. compute_text_mesh() returns FALSE
only on allocation failure and that's not supposed to happen in the
controlled conditions of the test. It's probably better to just fail
and crash in those cases.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic