Mesa (master): mesa: remove null check before free

Eduardo Lima Mitev elima at kemper.freedesktop.org
Thu May 5 07:53:48 UTC 2016


Module: Mesa
Branch: master
Commit: 76a423efe09dcaeb86badd3ec449da2ea56c5a9c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=76a423efe09dcaeb86badd3ec449da2ea56c5a9c

Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Wed May  4 06:15:37 2016 +0200

mesa: remove null check before free

Reviewed-by: Eduardo Lima Mitev <elima at igalia.com>

---

 src/mesa/main/readpix.c     | 3 +--
 src/mesa/main/texgetimage.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 882d863..1cb06c7 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -608,8 +608,7 @@ read_rgba_pixels( struct gl_context *ctx,
                                              dst, format, type);
    }
 
-   if (rgba)
-      free(rgba);
+   free(rgba);
 
 done_swap:
    /* Handle byte swapping if required */
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 4ac0ad4..fc3cc6b 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -557,8 +557,7 @@ get_tex_rgba_uncompressed(struct gl_context *ctx, GLuint dimensions,
    }
 
 done:
-   if (rgba)
-      free(rgba);
+   free(rgba);
 }
 
 




More information about the mesa-commit mailing list