summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-12-12 02:07:59 -0500
committerNick Mathewson <nickm@torproject.org>2009-12-12 02:07:59 -0500
commit0c1b3070cfec670190636d74f97c2aaf0e521bdb (patch)
treeba893e6987f7b429510cec38a1cb6aaf0dc13793 /src/common
parent79f72d0ef6cc3ce7cc92146ed0f0bdc7a4acad1a (diff)
downloadtor-0c1b3070cfec670190636d74f97c2aaf0e521bdb.tar.gz
tor-0c1b3070cfec670190636d74f97c2aaf0e521bdb.zip
Now that FOO_free(NULL) always works, remove checks before calling it.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/torgzip.c4
-rw-r--r--src/common/tortls.c6
-rw-r--r--src/common/util.c3
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);