From: Mark Adler Date: Fri, 30 Dec 2016 22:30:52 +0000 (-0800) Subject: No need to check for NULL argument to free(). X-Git-Tag: 1.9.9-b1~715 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca5fbeb1b8cf53b7740ebb9e2612b8a1cb61ce29;p=thirdparty%2Fzlib-ng.git No need to check for NULL argument to free(). --- diff --git a/gzread.c b/gzread.c index 131334508..a48d7bac1 100644 --- a/gzread.c +++ b/gzread.c @@ -85,10 +85,8 @@ static int gz_look(gz_statep 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; }