aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-12-22 12:27:26 -0500
committerNick Mathewson <nickm@torproject.org>2014-12-22 12:27:26 -0500
commit03d2df62f614f97d2b5cf52518565ce91333ba87 (patch)
tree0d9ae7750a5bfd29c886a3820306fdec97fbae78 /src/or
parentb94cb401d2185566e7fb52b78c5a5a6747987f99 (diff)
downloadtor-03d2df62f614f97d2b5cf52518565ce91333ba87.tar.gz
tor-03d2df62f614f97d2b5cf52518565ce91333ba87.zip
Fix a bunch of memory leaks in the unit tests. Found with valgrind
Diffstat (limited to 'src/or')
-rw-r--r--src/or/channel.c3
-rw-r--r--src/or/channel.h2
-rw-r--r--src/or/transports.c4
-rw-r--r--src/or/transports.h2
4 files changed, 6 insertions, 5 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index 4826bdd0a7..cc609b5b72 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -147,7 +147,6 @@ HT_GENERATE2(channel_idmap, channel_idmap_entry_s, node, channel_idmap_hash,
channel_idmap_eq, 0.5, tor_reallocarray_, tor_free_);
static cell_queue_entry_t * cell_queue_entry_dup(cell_queue_entry_t *q);
-static void cell_queue_entry_free(cell_queue_entry_t *q, int handed_off);
#if 0
static int cell_queue_entry_is_padding(cell_queue_entry_t *q);
#endif
@@ -1569,7 +1568,7 @@ cell_queue_entry_dup(cell_queue_entry_t *q)
* them) or not (we should free).
*/
-static void
+STATIC void
cell_queue_entry_free(cell_queue_entry_t *q, int handed_off)
{
if (!q) return;
diff --git a/src/or/channel.h b/src/or/channel.h
index ec7a15f5f1..c4b909c5ad 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -380,6 +380,8 @@ struct cell_queue_entry_s {
/* Cell queue functions for benefit of test suite */
STATIC int chan_cell_queue_len(const chan_cell_queue_t *queue);
+
+STATIC void cell_queue_entry_free(cell_queue_entry_t *q, int handed_off);
#endif
/* Channel operations for subclasses and internal use only */
diff --git a/src/or/transports.c b/src/or/transports.c
index 2623f807d0..7999be3d33 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -112,8 +112,6 @@ static void parse_method_error(const char *line, int is_server_method);
#define parse_server_method_error(l) parse_method_error(l, 1)
#define parse_client_method_error(l) parse_method_error(l, 0)
-static INLINE void free_execve_args(char **arg);
-
/** Managed proxy protocol strings */
#define PROTO_ENV_ERROR "ENV-ERROR"
#define PROTO_NEG_SUCCESS "VERSION"
@@ -1502,7 +1500,7 @@ pt_kickstart_proxy, (const smartlist_t *transport_list,
/** Frees the array of pointers in <b>arg</b> used as arguments to
execve(2). */
-static INLINE void
+STATIC void
free_execve_args(char **arg)
{
char **tmp = arg;
diff --git a/src/or/transports.h b/src/or/transports.h
index 2958d5e187..8f60760de8 100644
--- a/src/or/transports.h
+++ b/src/or/transports.h
@@ -131,6 +131,8 @@ STATIC int configure_proxy(managed_proxy_t *mp);
STATIC char* get_pt_proxy_uri(void);
+STATIC void free_execve_args(char **arg);
+
#endif
#endif