Skip to content

Commit 0a0bcfe

Browse files
Skip redundant 'else'
1 parent 031bba5 commit 0a0bcfe

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/fwrite.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@ void fwriteMain(fwriteMainArgs args)
798798
// init compress variables
799799
#ifndef NOZLIB
800800
z_stream strm;
801-
char *zbuffPool;
801+
// NB: fine to free() this even if unallocated
802+
char *zbuffPool = NULL;
802803
size_t zbuffSize = 0;
803804
size_t compress_len = 0;
804805
if (args.is_gzip) {
@@ -828,9 +829,6 @@ void fwriteMain(fwriteMainArgs args)
828829
zbuffSize / MEGA, nth, errno, strerror(errno));
829830
// # nocov end
830831
}
831-
} else {
832-
// if no is_gzip, malloc 0 for allowing freeing zbuffPool
833-
zbuffPool = malloc(0);
834832
}
835833

836834
#endif

0 commit comments

Comments
 (0)