From 149945c432115ef27788216063dd453624caa9e9 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sat, 12 Sep 2009 14:07:48 -0700 Subject: [PATCH] tgsi: free tokens on error --- src/gallium/auxiliary/tgsi/tgsi_ureg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index 0780e2e0635..e24a0ad776e 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; -- 2.30.2