diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2016-12-30 14:30:52 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2016-12-30 14:30:52 -0800 |
commit | feafcfaa05537869bd128af5474f62b19df8b502 (patch) | |
tree | 6260678defdb37bf1c56e555899bfb1d2623aead /gzread.c | |
parent | 77bc4f8944c0e1a1fd4689eddbcead6e93bef58a (diff) | |
download | zlib-feafcfaa05537869bd128af5474f62b19df8b502.tar.gz zlib-feafcfaa05537869bd128af5474f62b19df8b502.tar.bz2 zlib-feafcfaa05537869bd128af5474f62b19df8b502.zip |
No need to check for NULL argument to free().
Diffstat (limited to 'gzread.c')
-rw-r--r-- | gzread.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -95,10 +95,8 @@ local int gz_look(state) | |||
95 | state->in = (unsigned char *)malloc(state->want); | 95 | state->in = (unsigned char *)malloc(state->want); |
96 | state->out = (unsigned char *)malloc(state->want << 1); | 96 | state->out = (unsigned char *)malloc(state->want << 1); |
97 | if (state->in == NULL || state->out == NULL) { | 97 | if (state->in == NULL || state->out == NULL) { |
98 | if (state->out != NULL) | 98 | free(state->out); |
99 | free(state->out); | 99 | free(state->in); |
100 | if (state->in != NULL) | ||
101 | free(state->in); | ||
102 | gz_error(state, Z_MEM_ERROR, "out of memory"); | 100 | gz_error(state, Z_MEM_ERROR, "out of memory"); |
103 | return -1; | 101 | return -1; |
104 | } | 102 | } |