diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/torgzip.c | 4 | ||||
-rw-r--r-- | src/common/tortls.c | 6 | ||||
-rw-r--r-- | src/common/util.c | 3 |
3 files changed, 4 insertions, 9 deletions
diff --git a/src/common/torgzip.c b/src/common/torgzip.c index 13e0c7fb7c..4f1b46adde 100644 --- a/src/common/torgzip.c +++ b/src/common/torgzip.c @@ -165,9 +165,7 @@ tor_gzip_compress(char **out, size_t *out_len, deflateEnd(stream); tor_free(stream); } - if (*out) { - tor_free(*out); - } + tor_free(*out); return -1; } diff --git a/src/common/tortls.c b/src/common/tortls.c index 0fde617717..86f07a270a 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -1314,10 +1314,8 @@ log_cert_lifetime(X509 *cert, const char *problem) tls_log_errors(NULL, LOG_WARN, LD_NET, "getting certificate lifetime"); if (bio) BIO_free(bio); - if (s1) - tor_free(s1); - if (s2) - tor_free(s2); + tor_free(s1); + tor_free(s2); } /** Helper function: try to extract a link certificate and an identity diff --git a/src/common/util.c b/src/common/util.c index 989efd9581..5ad12c3e65 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -953,8 +953,7 @@ const char * escaped(const char *s) { static char *_escaped_val = NULL; - if (_escaped_val) - tor_free(_escaped_val); + tor_free(_escaped_val); if (s) _escaped_val = esc_for_log(s); |