This avoids accidental dereferencing of an invalid memory address by 
_mesa_align_free when passed pointer is NULL.

Also cleaned up different places where it was used, to avoid double check of 
passed pointer.

Now it is safe to pass NULL pointer to this function and expect same behavior 
like free().


Best Regards,
Siavash Eliasi.

Siavash Eliasi (1):
  Modified _mesa_align_free to have consistent behavior when dealing
    with NULL memory address.

 src/mesa/main/imports.c                |  7 +++++--
 src/mesa/math/m_matrix.c               | 13 +++++--------
 src/mesa/program/prog_parameter.c      |  3 +--
 src/mesa/state_tracker/st_cb_texture.c |  6 ++----
 src/mesa/swrast/s_texture.c            |  7 +++----
 src/mesa/tnl/t_vertex.c                |  6 ++----
 src/mesa/vbo/vbo_exec_api.c            |  9 ++++-----
 7 files changed, 22 insertions(+), 29 deletions(-)

-- 
1.8.4.2

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to