No need to check for NULL argument to free().
This commit is contained in:
parent
77bc4f8944
commit
feafcfaa05
6
gzread.c
6
gzread.c
@ -95,10 +95,8 @@ local int gz_look(state)
|
|||||||
state->in = (unsigned char *)malloc(state->want);
|
state->in = (unsigned char *)malloc(state->want);
|
||||||
state->out = (unsigned char *)malloc(state->want << 1);
|
state->out = (unsigned char *)malloc(state->want << 1);
|
||||||
if (state->in == NULL || state->out == NULL) {
|
if (state->in == NULL || state->out == NULL) {
|
||||||
if (state->out != NULL)
|
free(state->out);
|
||||||
free(state->out);
|
free(state->in);
|
||||||
if (state->in != NULL)
|
|
||||||
free(state->in);
|
|
||||||
gz_error(state, Z_MEM_ERROR, "out of memory");
|
gz_error(state, Z_MEM_ERROR, "out of memory");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user