diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 63bc2433c4e4276724950f8e25be16f763fc8e1a..84d76f4b9841ebb00166cb0b2372c30f8ce24797 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -158,11 +158,7 @@ Curl_unencode_deflate_write(struct connectdata *conn, /* Initialize zlib? */ if(k->zlib_init == ZLIB_UNINIT) { - z->zalloc = (alloc_func)Z_NULL; - z->zfree = (free_func)Z_NULL; - z->opaque = 0; - z->next_in = NULL; - z->avail_in = 0; + memset(z, 0, sizeof(z_stream)); if(inflateInit(z) != Z_OK) return process_zlib_error(conn, z); k->zlib_init = ZLIB_INIT; @@ -269,11 +265,7 @@ Curl_unencode_gzip_write(struct connectdata *conn, /* Initialize zlib? */ if(k->zlib_init == ZLIB_UNINIT) { - z->zalloc = (alloc_func)Z_NULL; - z->zfree = (free_func)Z_NULL; - z->opaque = 0; - z->next_in = NULL; - z->avail_in = 0; + memset(z, 0, sizeof(z_stream)); if(strcmp(zlibVersion(), "1.2.0.4") >= 0) { /* zlib ver. >= 1.2.0.4 supports transparent gzip decompressing */ diff --git a/src/mkhelp.pl b/src/mkhelp.pl index 1d1be601eaef663466f0329843532b37b39d7029..e9de8429d0cf209ec0cc863599a0eb080d77b41d 100644 --- a/src/mkhelp.pl +++ b/src/mkhelp.pl @@ -177,11 +177,9 @@ void hugehelp(void) return; headerlen = 10; + memset(&z, 0, sizeof(z_stream)); z.avail_in = (unsigned int)(sizeof(hugehelpgz) - headerlen); z.next_in = (unsigned char *)hugehelpgz + headerlen; - z.zalloc = (alloc_func)Z_NULL; - z.zfree = (free_func)Z_NULL; - z.opaque = 0; if (inflateInit2(&z, -MAX_WBITS) != Z_OK) return;