mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 17:48:10 +02:00
ralloc: don't write to memory in case of alloc fail.
For some reason I made this happen under indirect rendering,
I think we might have a leak, valgrind gave out, so I said I'd
fix the basic problem.
NOTE: This is a candidate for stable branches.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 47bd6e46fe)
This commit is contained in:
parent
1665f29c29
commit
ed00ea3444
1 changed files with 2 additions and 0 deletions
|
|
@ -108,6 +108,8 @@ ralloc_size(const void *ctx, size_t size)
|
|||
{
|
||||
void *block = calloc(1, size + sizeof(ralloc_header));
|
||||
|
||||
if (unlikely(block == NULL))
|
||||
return NULL;
|
||||
ralloc_header *info = (ralloc_header *) block;
|
||||
ralloc_header *parent = ctx != NULL ? get_header(ctx) : NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue