diff options
author | Dave Airlie <airlied@redhat.com> | 2015-12-22 09:04:19 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-12-22 09:04:54 +1000 |
commit | aee033c1c4388fc6a455d9b636ce20e5111d494d (patch) | |
tree | a296dc69143570faf6800c3cac15a1cf5d2b6960 | |
parent | 0eeb2e7e3a3c3ea8803cfa8d04f242115a33dfe2 (diff) |
renderer: don't free tmp_buf if shader create fails.
Noticed by Marc-Andre.
-rw-r--r-- | src/vrend_renderer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index e584a36..0d3298f 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -2169,9 +2169,12 @@ int vrend_create_shader(struct vrend_context *ctx, if (!tgsi_text_translate((const char *)shd_text, tokens, num_tokens + 10)) return EINVAL; - vrend_finish_shader(ctx, sel, tokens); - free(sel->tmp_buf); - sel->tmp_buf = NULL; + if (vrend_finish_shader(ctx, sel, tokens)) + new_shader = false; + else { + free(sel->tmp_buf); + sel->tmp_buf = NULL; + } free(tokens); ctx->sub->long_shader_in_progress_handle[type] = 0; } |