--- pgp/src/zinflate.c 2018/04/24 16:38:47 1.1.1.2 +++ pgp/src/zinflate.c 2018/04/24 16:39:30 1.1.1.3 @@ -130,6 +130,7 @@ */ #include "zunzip.h" +#include "exitpgp.h" #define OF __ #ifndef WSIZE @@ -974,14 +975,17 @@ void inflate() /* ignore the return code for now ... */ { #ifdef DYN_ALLOC - if (window == NULL) { - window = (char*) calloc((unsigned)WSIZE, 2*sizeof(char)); + window = (char*) calloc((unsigned)WSIZE, 2*sizeof(char)); /* Note that inflate only needs WSIZE bytes, but the window * array is shared with deflate, which needs 2*WISZE bytes. */ - if (window==NULL) err(4, ""); - } + if (window==NULL) err(4, ""); #endif inflate_entry(); + +#ifdef DYN_ALLOC + free(window); + window = NULL; +#endif }