mesa: fix potential mem leak in generate_mipmap_compressed()
authorBrian Paul <brianp@vmware.com>
Thu, 1 Dec 2011 23:37:49 +0000 (16:37 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 2 Dec 2011 14:22:39 +0000 (07:22 -0700)
Fixes a coverity warning.

Reviewed-by: Vinson Lee <vlee@vmware.com>
src/mesa/main/mipmap.c

index c621800c0fa939bd9220601a01488ffaf91ea7bf..fd6e582ec92a2d2ba850b3712b54c753621595cb 100644 (file)
@@ -2048,6 +2048,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
       dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1);
       if (!dstImage) {
          _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
+         free(temp_dst);
          return;
       }