1
0
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:
Alex Murkoff
2024-04-13 02:24:14 +07:00
parent 592de19843
commit 1d5e9705db
10 changed files with 19 additions and 10 deletions

View File

@ -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;