mirror of
https://github.com/facebook/zstd.git
synced 2025-07-29 11:21:22 +03:00
fixed memory leaks and almost all undefined behaviour
This commit is contained in:
@ -234,7 +234,7 @@ int gzwrite _Z_OF((gzFile, const void *, unsigned));
|
||||
|
||||
int gzwrite(gzFile gz, const void *buf, unsigned len) {
|
||||
z_stream *strm;
|
||||
unsigned char out[BUFLEN];
|
||||
unsigned char out[BUFLEN] = 0;
|
||||
|
||||
if (gz == NULL || !gz->write)
|
||||
return 0;
|
||||
@ -287,7 +287,7 @@ int gzclose _Z_OF((gzFile));
|
||||
|
||||
int gzclose(gzFile gz) {
|
||||
z_stream *strm;
|
||||
unsigned char out[BUFLEN];
|
||||
unsigned char out[BUFLEN] = 0;
|
||||
|
||||
if (gz == NULL)
|
||||
return Z_STREAM_ERROR;
|
||||
|
Reference in New Issue
Block a user