aboutsummaryrefslogtreecommitdiff
path: root/src/common/torgzip.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-06-08 18:30:23 -0400
committerNick Mathewson <nickm@torproject.org>2016-06-19 12:20:24 -0400
commit358fc026d97f87166dc3059f56012334317de8ea (patch)
treec01d4836a2f331788f7380ff0ee5b9c3df56ffe5 /src/common/torgzip.c
parent808015316a5680003b78393c50b0701c47e1051c (diff)
downloadtor-358fc026d97f87166dc3059f56012334317de8ea.tar.gz
tor-358fc026d97f87166dc3059f56012334317de8ea.zip
Remove a ridiculous realloc call from torgzip.c
realloc()ing a thing in order to try to save memory on it just doesn't make sense with today's allocators. Instead, let's use the fact that whenever we decompress something, either it isn't too big, or we chop it up, or we reallocate it.
Diffstat (limited to 'src/common/torgzip.c')
-rw-r--r--src/common/torgzip.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/common/torgzip.c b/src/common/torgzip.c
index 57994c462e..85114e6bf6 100644
--- a/src/common/torgzip.c
+++ b/src/common/torgzip.c
@@ -213,10 +213,6 @@ tor_gzip_compress(char **out, size_t *out_len,
* the newly unsigned field isn't negative." */
tor_assert(stream->total_out >= 0);
#endif
- if (((size_t)stream->total_out) > out_size + 4097) {
- /* If we're wasting more than 4k, don't. */
- *out = tor_realloc(*out, stream->total_out + 1);
- }
if (deflateEnd(stream)!=Z_OK) {
log_warn(LD_BUG, "Error freeing gzip structures");
goto err;