swrast: Fix memory leak.
authorVinson Lee <vlee@freedesktop.org>
Fri, 1 Feb 2013 07:28:41 +0000 (23:28 -0800)
committerVinson Lee <vlee@freedesktop.org>
Sat, 2 Feb 2013 06:49:45 +0000 (22:49 -0800)
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/dri/swrast/swrast.c

index 96382718a8ecc16e081ae8de93efdba9ba1fb9f8..b380de3078c5fe451d2f82062a4d651da5545b29 100644 (file)
@@ -363,6 +363,7 @@ swrast_new_renderbuffer(const struct gl_config *visual, __DRIdrawable *dPriv,
        xrb->bpp = 8;
        break;
     default:
+       free(xrb);
        return NULL;
     }