aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2019-04-30 19:21:15 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2019-04-30 19:21:15 +0300
commit9084a90b00e51c92595347f8ac796df93876dc1a (patch)
treeebfb659d0879f3edd4dba0f1f49af8d409978427 /src/lib
parenta44aca5453ca944369a9ab9b589499bed56c3599 (diff)
parente39b53ef7de4ac6705869fd153da7b0f87c48ee6 (diff)
downloadtor-9084a90b00e51c92595347f8ac796df93876dc1a.tar.gz
tor-9084a90b00e51c92595347f8ac796df93876dc1a.zip
Merge branch 'tor-github/pr/936'
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/net/address.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 214d8aa3eb..7dec4c8e25 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -2027,8 +2027,12 @@ string_is_valid_nonrfc_hostname(const char *string)
smartlist_split_string(components,string,".",0,0);
- if (BUG(smartlist_len(components) == 0))
- return 0; // LCOV_EXCL_LINE should be impossible given the earlier checks.
+ if (BUG(smartlist_len(components) == 0)) {
+ // LCOV_EXCL_START should be impossible given the earlier checks.
+ smartlist_free(components);
+ return 0;
+ // LCOV_EXCL_STOP
+ }
/* Allow a single terminating '.' used rarely to indicate domains
* are FQDNs rather than relative. */