uncompress: fix uncompress_buf usage
uncompress_buf is used each time uncompress is called, so make sure it is initialized correctly so that we do not call free() on an already free pointer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
3180d4b3e3
commit
9f0c582950
|
@ -84,6 +84,8 @@ int uncompress(unsigned char *inbuf, int len,
|
|||
|
||||
if (inbuf) {
|
||||
ft = file_detect_type(inbuf);
|
||||
uncompress_buf = NULL;
|
||||
uncompress_size = 0;
|
||||
} else {
|
||||
if (!fill)
|
||||
return -EINVAL;
|
||||
|
@ -127,7 +129,6 @@ int uncompress(unsigned char *inbuf, int len,
|
|||
flush, output, pos, error_fn);
|
||||
err:
|
||||
free(uncompress_buf);
|
||||
uncompress_size = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue