We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 031bba5 commit 0a0bcfeCopy full SHA for 0a0bcfe
src/fwrite.c
@@ -798,7 +798,8 @@ void fwriteMain(fwriteMainArgs args)
798
// init compress variables
799
#ifndef NOZLIB
800
z_stream strm;
801
- char *zbuffPool;
+ // NB: fine to free() this even if unallocated
802
+ char *zbuffPool = NULL;
803
size_t zbuffSize = 0;
804
size_t compress_len = 0;
805
if (args.is_gzip) {
@@ -828,9 +829,6 @@ void fwriteMain(fwriteMainArgs args)
828
829
zbuffSize / MEGA, nth, errno, strerror(errno));
830
// # nocov end
831
}
- } else {
832
- // if no is_gzip, malloc 0 for allowing freeing zbuffPool
833
- zbuffPool = malloc(0);
834
835
836
#endif
0 commit comments