diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-04-11 17:51:11 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-11 17:51:11 -0400 |
commit | 781d69f3a7e1c9d70120cda970b203dea4180b99 (patch) | |
tree | 7d4415f16f17354e1101669d594cd9baf6c868a1 /src/core/or/protover.c | |
parent | 4e3d144fb0940d8ee5a89427d471ea3656e8e122 (diff) | |
download | tor-781d69f3a7e1c9d70120cda970b203dea4180b99.tar.gz tor-781d69f3a7e1c9d70120cda970b203dea4180b99.zip |
Make it clear to coverity we aren't leaking in protover_all_supported()
The logic here should be "use versions or free it". The "free it"
part was previously in a kind of obfuscated place, so coverity
wasn't sure it was invoked as appropriate. CID 1437436.
Diffstat (limited to 'src/core/or/protover.c')
-rw-r--r-- | src/core/or/protover.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/or/protover.c b/src/core/or/protover.c index 53709ad002..1edf78ec87 100644 --- a/src/core/or/protover.c +++ b/src/core/or/protover.c @@ -820,6 +820,8 @@ protover_all_supported(const char *s, char **missing_out) * ones and, if so, add them to unsupported->ranges. */ if (versions->low != 0 && versions->high != 0) { smartlist_add(unsupported->ranges, versions); + } else { + tor_free(versions); } /* Finally, if we had something unsupported, add it to the list of * missing_some things and mark that there was something missing. */ @@ -828,7 +830,6 @@ protover_all_supported(const char *s, char **missing_out) all_supported = 0; } else { proto_entry_free(unsupported); - tor_free(versions); } } SMARTLIST_FOREACH_END(range); |