aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/torgzip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/torgzip.c b/src/common/torgzip.c
index 180c1e6df..f75ef8350 100644
--- a/src/common/torgzip.c
+++ b/src/common/torgzip.c
@@ -76,14 +76,14 @@ tor_gzip_compress(char **out, size_t *out_len,
tor_assert(in);
tor_assert(in_len < UINT_MAX);
+ *out = NULL;
+
if (method == GZIP_METHOD && !is_gzip_supported()) {
/* Old zlib version don't support gzip in deflateInit2 */
log_warn(LD_BUG, "Gzip not supported with zlib %s", ZLIB_VERSION);
- return -1;
+ goto err;
}
- *out = NULL;
-
stream = tor_malloc_zero(sizeof(struct z_stream_s));
stream->zalloc = Z_NULL;
stream->zfree = Z_NULL;