renderer: don't free tmp_buf if shader create fails.

Noticed by Marc-Andre.
macos/master
Dave Airlie 9 years ago
parent 0eeb2e7e3a
commit aee033c1c4
  1. 9
      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;
}

Loading…
Cancel
Save