From b3177d509ea145db49e41c67c65face8b686096c Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Mon, 28 Feb 2005 01:59:18 +0000 Subject: free some more memory at shutdown svn:r3707 --- src/or/main.c | 2 ++ src/or/rephist.c | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/or/main.c b/src/or/main.c index 46d88711b3..24796df138 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1265,6 +1265,8 @@ void tor_free_all(void) tor_tls_free_all(); /* stuff in main.c */ smartlist_free(closeable_connection_lst); + + close_logs(); /* free log strings. do this last so logs keep working. */ } /** Do whatever cleanup is necessary before shutting Tor down. */ diff --git a/src/or/rephist.c b/src/or/rephist.c index a00a5c6678..bc9861b255 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -640,6 +640,13 @@ static void predicted_ports_init(void) { add_predicted_port(80, time(NULL)); /* add one to kickstart us */ } +static void predicted_ports_free(void) { + SMARTLIST_FOREACH(predicted_ports_list, char *, cp, tor_free(cp)); + smartlist_free(predicted_ports_list); + SMARTLIST_FOREACH(predicted_ports_times, char *, cp, tor_free(cp)); + smartlist_free(predicted_ports_times); +} + /** Remember that port has been asked for as of time now. * This is used for predicting what sorts of streams we'll make in the * future and making circuits to anticipate that. @@ -736,4 +743,5 @@ void rep_hist_free_all(void) strmap_free(history_map, free_or_history); tor_free(read_array); tor_free(write_array); + predicted_ports_free(); } -- cgit v1.2.3-54-g00ecf