]> git.lizzy.rs Git - zlib.git/commitdiff
No need to check for NULL argument to free().
authorMark Adler <madler@alumni.caltech.edu>
Fri, 30 Dec 2016 22:30:52 +0000 (14:30 -0800)
committerMark Adler <madler@alumni.caltech.edu>
Fri, 30 Dec 2016 22:30:52 +0000 (14:30 -0800)
gzread.c

index ebf2c184d7f07b7467f3df9d53a1ba99e6987083..38111578a8c228eb398e644d09e32f96a9754bf7 100644 (file)
--- a/gzread.c
+++ b/gzread.c
@@ -95,10 +95,8 @@ local int gz_look(state)
         state->in = (unsigned char *)malloc(state->want);
         state->out = (unsigned char *)malloc(state->want << 1);
         if (state->in == NULL || state->out == NULL) {
-            if (state->out != NULL)
-                free(state->out);
-            if (state->in != NULL)
-                free(state->in);
+            free(state->out);
+            free(state->in);
             gz_error(state, Z_MEM_ERROR, "out of memory");
             return -1;
         }