summaryrefslogtreecommitdiff
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-06-19 11:19:08 +0200
committerMichel Dänzer <daenzer@vmware.com>2009-06-19 18:00:33 +0200
commita120778c72324bc56c63cd0f1873c6f2772228ea (patch)
treeb27c04704115354cc4eca66bd17eeb1b538c1fe0 /src/mesa/main/teximage.c
parent3cf92e936afbef91b856f064742f1bc2ad9e601a (diff)
Always free image offsets memory when re-initializing texture image fields.
Fixes leak running compiz with direct rendering.
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 76b46d700b..6e21066537 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1250,6 +1250,8 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
* We allocate the array for 1D/2D textures too in order to avoid special-
* case code in the texstore routines.
*/
+ if (img->ImageOffsets)
+ _mesa_free(img->ImageOffsets);
img->ImageOffsets = (GLuint *) _mesa_malloc(depth * sizeof(GLuint));
for (i = 0; i < depth; i++) {
img->ImageOffsets[i] = i * width * height;