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 ef677170a5ba71815045372b57e978670ac2b1bb..d324d59f48d70eb3f6728507fb748fffeb253f20 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;
                }
        }