summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-09-12 14:07:48 -0700
committerKeith Whitwell <keithw@vmware.com>2009-09-12 14:07:48 -0700
commit149945c432115ef27788216063dd453624caa9e9 (patch)
treeae533a45158e872c9cef26a75dd6d60cf8036923 /src/gallium/auxiliary/tgsi
parente90fb86ac3f3a000c91d2cd9fab2bf27d4ede0e7 (diff)
tgsi: free tokens on error
Diffstat (limited to 'src/gallium/auxiliary/tgsi')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 0780e2e063..e24a0ad776 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -120,6 +120,9 @@ static union tgsi_any_token error_tokens[32];
static void tokens_error( struct ureg_tokens *tokens )
{
+ if (tokens->tokens && tokens->tokens != error_tokens)
+ FREE(tokens->tokens);
+
tokens->tokens = error_tokens;
tokens->size = Elements(error_tokens);
tokens->count = 0;