summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorSiavash Eliasi <[email protected]>2013-12-03 21:50:00 -0700
committerBrian Paul <[email protected]>2013-12-04 07:31:27 -0700
commitf0cc59d68a9f5231e8e2111393a1834858820735 (patch)
treee8261356dc2405630122615badac6777ae760c81 /src/mesa/swrast
parent267679be84de5bc9d2bd0fccb1712bc5cddb6be7 (diff)
mesa: modified _mesa_align_free() to accept NULL pointer
So that it acts like ordinary free(). This lets us remove a bunch of if statements where the function is called. v2: - Avoiding compile error on MSVC and possible warnings on other compilers. - Added comment regards passing NULL pointer being safe. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_texture.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index 27803c55330..c08a4e9d1e4 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -164,10 +164,9 @@ _swrast_free_texture_image_buffer(struct gl_context *ctx,
struct gl_texture_image *texImage)
{
struct swrast_texture_image *swImage = swrast_texture_image(texImage);
- if (swImage->Buffer) {
- _mesa_align_free(swImage->Buffer);
- swImage->Buffer = NULL;
- }
+
+ _mesa_align_free(swImage->Buffer);
+ swImage->Buffer = NULL;
free(swImage->ImageSlices);
swImage->ImageSlices = NULL;