aboutsummaryrefslogtreecommitdiff
path: root/src/or/geoip.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-28 22:49:32 -0500
committerNick Mathewson <nickm@torproject.org>2012-12-28 22:49:32 -0500
commitd3aabf4db176a44d19046b58b99f2edb8c5f49bb (patch)
treed804e239d5e0c4993c82f40cb97b25a1f7f73132 /src/or/geoip.c
parentb509ead20d93277697c1cb961a2ae520bce7fd7f (diff)
downloadtor-d3aabf4db176a44d19046b58b99f2edb8c5f49bb.tar.gz
tor-d3aabf4db176a44d19046b58b99f2edb8c5f49bb.zip
Fix various small leaks on error cases
Spotted by coverity, bug 7816, bugfix on various versions.
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r--src/or/geoip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 6b7cc82b82..8ca95af2e6 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -1316,8 +1316,11 @@ load_bridge_stats(time_t now)
fname = get_datadir_fname2("stats", "bridge-stats");
contents = read_file_to_str(fname, RFTS_IGNORE_MISSING, NULL);
- if (contents && validate_bridge_stats(contents, now))
+ if (contents && validate_bridge_stats(contents, now)) {
bridge_stats_extrainfo = contents;
+ } else {
+ tor_free(contents);
+ }
tor_free(fname);
}