[Mesa-dev] [PATCH] svga: avoid freeing non-malloced memory

2016-03-25 Thread Brian Paul
svga_shader_expand() will fall back to using non-malloced memory for emit.buf if malloc fails. We should check if the memory is malloced before freeing it in the error path of svga_tgsi_vgpu9_translate. Original patch by Thomas Hindoe Paaboel Andersen . Remove trivial svga_destroy_shader_emitter()

Re: [Mesa-dev] [PATCH] svga: avoid freeing non-malloced memory

2016-03-25 Thread Brian Paul
On 03/24/2016 04:36 PM, Thomas Hindoe Paaboel Andersen wrote: svga_shader_expand will fall back to using non-malloced memory for emit.buf if malloc fails. We should check if the memory is malloced before freeing it in the error path of svga_tgsi_vgpu9_translate. --- All we need to do is check if

[Mesa-dev] [PATCH] svga: avoid freeing non-malloced memory

2016-03-24 Thread Thomas Hindoe Paaboel Andersen
svga_shader_expand will fall back to using non-malloced memory for emit.buf if malloc fails. We should check if the memory is malloced before freeing it in the error path of svga_tgsi_vgpu9_translate. --- All we need to do is check if emit->buf points to the err_buf. I was surprised to see a functi