mesa: Removed unnecessary check for NULL pointer when freeing memory
authorSiavash Eliasi <siavashserver@gmail.com>
Thu, 30 Jan 2014 08:08:55 +0000 (11:38 +0330)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 9 Feb 2014 15:16:34 +0000 (16:16 +0100)
Note that it is OK to pass NULL pointers to this function since this commit:

mesa: modified _mesa_align_free() to accept NULL pointer
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0cc59d68a9f5231e8e2111393a1834858820735

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/bufferobj.c

index ca55ef9693f7b8a5b9f922321c6d6ce9c39e9386..d22e2c47d81d5a8cfd1a17611223baf2a90f2481 100644 (file)
@@ -562,8 +562,7 @@ _mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
 
    (void) target;
 
-   if (bufObj->Data)
-      _mesa_align_free( bufObj->Data );
+   _mesa_align_free( bufObj->Data );
 
    new_data = _mesa_align_malloc( size, ctx->Const.MinMapBufferAlignment );
    if (new_data) {