From 8aa77ab430a5f4be6a5760ee7d07fb90882f92e2 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 14 Sep 2016 21:15:59 +0200 Subject: [PATCH] if inflate() fails, free the stream instead of leaking it pointed out by guenther@openbsd.org --- ctfdump.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ctfdump.c b/ctfdump.c index 52dbbab..02a5fce 100644 --- 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; } -- 2.36.1