commit e7242ceefd84094a2e7f3dc4a4eb7d6a557a7a78 from: Stefan Sperling date: Mon Jul 09 13:59:44 2018 UTC less memset() needed in got_inflate_init() commit - d746408514803a55d763495c6a567c4142718232 commit + e7242ceefd84094a2e7f3dc4a4eb7d6a557a7a78 blob - 85e1798e7ce36e945d837778bafed18dbe0dbd92 blob + a66a9a6d3d15d38eaf238856a1e994e335d9579a --- lib/zbuf.c +++ lib/zbuf.c @@ -38,7 +38,7 @@ got_inflate_init(struct got_zstream_buf *zb, uint8_t * { const struct got_error *err = NULL; - memset(zb, 0, sizeof(*zb)); + memset(&zb->z, 0, sizeof(zb->z)); zb->z.zalloc = Z_NULL; zb->z.zfree = Z_NULL; @@ -55,6 +55,7 @@ got_inflate_init(struct got_zstream_buf *zb, uint8_t * goto done; } + zb->flags = 0; if (outbuf == NULL) { zb->outbuf = calloc(1, zb->outlen); if (zb->outbuf == NULL) {