mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
mesa: Use _mesa_align_malloc in _mesa_buffer_data
v2: Fixed memory leak. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
689b20cfe0
commit
f772d51c25
1 changed files with 5 additions and 2 deletions
|
|
@ -560,9 +560,12 @@ _mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
|
|||
{
|
||||
void * new_data;
|
||||
|
||||
(void) ctx; (void) target;
|
||||
(void) target;
|
||||
|
||||
new_data = _mesa_realloc( bufObj->Data, bufObj->Size, size );
|
||||
if (bufObj->Data)
|
||||
_mesa_align_free( bufObj->Data );
|
||||
|
||||
new_data = _mesa_align_malloc( size, ctx->Const.MinMapBufferAlignment );
|
||||
if (new_data) {
|
||||
bufObj->Data = (GLubyte *) new_data;
|
||||
bufObj->Size = size;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue