From d3aabf4db176a44d19046b58b99f2edb8c5f49bb Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 28 Dec 2012 22:49:32 -0500 Subject: Fix various small leaks on error cases Spotted by coverity, bug 7816, bugfix on various versions. --- src/or/geoip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/or/geoip.c') 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); } -- cgit v1.2.3-54-g00ecf