mirror of
https://github.com/reactos/reactos.git
synced 2024-07-12 23:55:07 +00:00
- fix possible memory leak (patch from Mesa3D by Daniel Zimmermann)
svn path=/trunk/; revision=40286
This commit is contained in:
parent
df5b7d2582
commit
a83abb4f0e
|
@ -106,14 +106,6 @@ bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int us
|
||||||
int the_ustride;
|
int the_ustride;
|
||||||
int the_vstride;
|
int the_vstride;
|
||||||
|
|
||||||
bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh));
|
|
||||||
assert(ret);
|
|
||||||
|
|
||||||
ret->bpatch = NULL;
|
|
||||||
ret->bpatch_normal = NULL;
|
|
||||||
ret->bpatch_color = NULL;
|
|
||||||
ret->bpatch_texcoord = NULL;
|
|
||||||
|
|
||||||
if(maptype == GL_MAP2_VERTEX_3) dimension = 3;
|
if(maptype == GL_MAP2_VERTEX_3) dimension = 3;
|
||||||
else if (maptype==GL_MAP2_VERTEX_4) dimension = 4;
|
else if (maptype==GL_MAP2_VERTEX_4) dimension = 4;
|
||||||
else {
|
else {
|
||||||
|
@ -121,7 +113,14 @@ bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int us
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh));
|
||||||
|
assert(ret);
|
||||||
|
|
||||||
|
ret->bpatch_normal = NULL;
|
||||||
|
ret->bpatch_color = NULL;
|
||||||
|
ret->bpatch_texcoord = NULL;
|
||||||
ret->bpatch = bezierPatchMake(umin, vmin, umax, vmax, uorder, vorder, dimension);
|
ret->bpatch = bezierPatchMake(umin, vmin, umax, vmax, uorder, vorder, dimension);
|
||||||
|
|
||||||
/*copy the control points there*/
|
/*copy the control points there*/
|
||||||
the_ustride = vorder * dimension;
|
the_ustride = vorder * dimension;
|
||||||
the_vstride = dimension;
|
the_vstride = dimension;
|
||||||
|
|
Loading…
Reference in a new issue