summaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2018-09-10 16:47:28 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2018-09-10 16:54:19 +0300
commit34a2cbb249cdaf23c88b93972a9216926a8d7551 (patch)
tree2dd087da8ee6a49906ed458af3277fe7fc082f2a /src/feature
parenta52d5d530956d2b2acf28400d1635b2fd1320f96 (diff)
downloadtor-34a2cbb249cdaf23c88b93972a9216926a8d7551.tar.gz
tor-34a2cbb249cdaf23c88b93972a9216926a8d7551.zip
Address coverity warnings (CID 1439133/1439132).
>>>> CID 1439133: Null pointer dereferences (REVERSE_INULL) >>>> Null-checking "fields" suggests that it may be null, but it >>>> has already been dereferenced on all paths leading to the check. >>>> CID 1439132: Null pointer dereferences (REVERSE_INULL) >>>> Null-checking "fields" suggests that it may be null, but it >>>> has already been dereferenced on all paths leading to the check.
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/hs/hs_client.c7
-rw-r--r--src/feature/hs/hs_service.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c
index 6f031eb3b9..a6384b87a3 100644
--- a/src/feature/hs/hs_client.c
+++ b/src/feature/hs/hs_client.c
@@ -1524,10 +1524,9 @@ parse_auth_file_content(const char *client_key_str)
if (seckey_b32) {
memwipe(seckey_b32, 0, strlen(seckey_b32));
}
- if (fields) {
- SMARTLIST_FOREACH(fields, char *, s, tor_free(s));
- smartlist_free(fields);
- }
+ tor_assert(fields);
+ SMARTLIST_FOREACH(fields, char *, s, tor_free(s));
+ smartlist_free(fields);
return auth;
}
diff --git a/src/feature/hs/hs_service.c b/src/feature/hs/hs_service.c
index 43e5626a57..30d23eb771 100644
--- a/src/feature/hs/hs_service.c
+++ b/src/feature/hs/hs_service.c
@@ -1192,10 +1192,9 @@ parse_authorized_client(const char *client_key_str)
if (pubkey_b32) {
memwipe(pubkey_b32, 0, strlen(pubkey_b32));
}
- if (fields) {
- SMARTLIST_FOREACH(fields, char *, s, tor_free(s));
- smartlist_free(fields);
- }
+ tor_assert(fields);
+ SMARTLIST_FOREACH(fields, char *, s, tor_free(s));
+ smartlist_free(fields);
return client;
}