summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-05-30 11:04:55 +1000
committerBen Skeggs <[email protected]>2008-05-30 11:04:55 +1000
commit996b549fdbfe772ee56a51858e81e93bccaae5c5 (patch)
tree1c0667f1aa37ecbf2372c5762720236aa73e47e7 /src
parent8b31d5fc8a5425b01adf80f4873cb816925ee0d1 (diff)
nv40: a couple of memory leaks
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nv40/nv40_state_viewport.c3
-rw-r--r--src/gallium/drivers/nv40/nv40_vertprog.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/nv40/nv40_state_viewport.c b/src/gallium/drivers/nv40/nv40_state_viewport.c
index 1b6248e5b8e..869a55b4053 100644
--- a/src/gallium/drivers/nv40/nv40_state_viewport.c
+++ b/src/gallium/drivers/nv40/nv40_state_viewport.c
@@ -3,8 +3,8 @@
static boolean
nv40_state_viewport_validate(struct nv40_context *nv40)
{
- struct nouveau_stateobj *so = so_new(11, 0);
struct pipe_viewport_state *vpt = &nv40->viewport;
+ struct nouveau_stateobj *so;
unsigned bypass;
if (nv40->render_mode == HW && !nv40->rasterizer->pipe.bypass_clipping)
@@ -18,6 +18,7 @@ nv40_state_viewport_validate(struct nv40_context *nv40)
return FALSE;
nv40->state.viewport_bypass = bypass;
+ so = so_new(11, 0);
if (!bypass) {
so_method(so, nv40->screen->curie,
NV40TCL_VIEWPORT_TRANSLATE_X, 8);
diff --git a/src/gallium/drivers/nv40/nv40_vertprog.c b/src/gallium/drivers/nv40/nv40_vertprog.c
index e10250528e2..eb14869bfe0 100644
--- a/src/gallium/drivers/nv40/nv40_vertprog.c
+++ b/src/gallium/drivers/nv40/nv40_vertprog.c
@@ -843,6 +843,12 @@ nv40_vertprog_translate(struct nv40_context *nv40,
vp->translated = TRUE;
out_err:
tgsi_parse_free(&parse);
+ if (vpc->r_temp)
+ FREE(vpc->r_temp);
+ if (vpc->r_address)
+ FREE(vpc->r_address);
+ if (vpc->imm)
+ FREE(vpc->imm);
FREE(vpc);
}