if inflate() fails, free the stream instead of leaking it
authorJasper Lievisse Adriaanse <jasper@humppa.nl>
Wed, 14 Sep 2016 19:15:59 +0000 (21:15 +0200)
committerJasper Lievisse Adriaanse <jasper@humppa.nl>
Wed, 14 Sep 2016 19:15:59 +0000 (21:15 +0200)
pointed out by guenther@openbsd.org

ctfdump.c

index 52dbbab607b45fe18ac78523145c2c81a865d256..02a5fce443fa8883deb27773eabfa206df9c842a 100644 (file)
--- a/ctfdump.c
+++ b/ctfdump.c
@@ -566,6 +566,7 @@ decompress(const char *buf, size_t size, off_t len)
 
        if ((error = inflate(&stream, Z_FINISH)) != Z_STREAM_END) {
                warnx("zlib inflate failed: %s", zError(error));
+               inflateEnd(&stream);
                goto exit;
        }