r600g: Fix memory leak in r600_bytecode_add_vtx.
authorVinson Lee <vlee@freedesktop.org>
Wed, 9 Jan 2013 07:09:00 +0000 (08:09 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Jan 2013 16:11:46 +0000 (11:11 -0500)
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
src/gallium/drivers/r600/r600_asm.c

index ef67717..d324d59 100644 (file)
@@ -1625,6 +1625,7 @@ int r600_bytecode_add_vtx(struct r600_bytecode *bc, const struct r600_bytecode_v
                        break;
                default:
                        R600_ERR("Unknown chip class %d.\n", bc->chip_class);
+                       free(nvtx);
                        return -EINVAL;
                }
        }