From 7565ee874096dd41b4bd7bccf080e7c46a57344f Mon Sep 17 00:00:00 2001 From: Unbit Date: Fri, 4 Oct 2013 12:29:16 +0200 Subject: [PATCH] fixed a memleak spotted by cppcheck --- core/zlib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/zlib.c b/core/zlib.c index a76d876d..5857980e 100644 --- a/core/zlib.c +++ b/core/zlib.c @@ -123,12 +123,13 @@ int uwsgi_gzip_fix(z_stream *z, uint32_t crc32, struct uwsgi_buffer *ub, size_t if (!gzipped0) goto end; if (uwsgi_buffer_append(ub, gzipped0, dlen0)) goto end; free(gzipped0); - if (uwsgi_buffer_u32le(ub, crc32)) goto end; - if (uwsgi_buffer_u32le(ub, len)) goto end; + if (uwsgi_buffer_u32le(ub, crc32)) goto end2; + if (uwsgi_buffer_u32le(ub, len)) goto end2; deflateEnd(z); return 0; end: if (gzipped0) free(gzipped0); +end2: deflateEnd(z); return -1; }