Mesa (master): mesa: Fix memory leak in out-of-memory path.

Vinson Lee vlee at kemper.freedesktop.org
Mon Oct 24 14:13:43 PDT 2011


Module: Mesa
Branch: master
Commit: 4e6a0b40c5bb31101718f25ffaff8ffeb3d921b9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4e6a0b40c5bb31101718f25ffaff8ffeb3d921b9

Author: Vinson Lee <vlee at vmware.com>
Date:   Mon Oct 24 11:57:15 2011 -0700

mesa: Fix memory leak in out-of-memory path.

Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/pack.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index 092e541..ecdeaf5 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -3717,6 +3717,7 @@ _mesa_unpack_color_span_ubyte(struct gl_context *ctx,
 
          if (!indexes) {
             _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
+            free(rgba);
             return;
          }
 



More information about the mesa-commit mailing list