aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-09-03 10:59:39 -0400
committerNick Mathewson <nickm@torproject.org>2014-09-03 10:59:39 -0400
commited8f020e205267e6270494634346ab68d830e1d8 (patch)
treea3adc95f2121f56bfeb064d08ab0830f28e45163 /src/or/control.c
parentc4d0d30bf3e621d5f7a7b27a7480bcdabe6274c6 (diff)
downloadtor-ed8f020e205267e6270494634346ab68d830e1d8.tar.gz
tor-ed8f020e205267e6270494634346ab68d830e1d8.zip
Fix a couple of small memory leaks on failure cases.
[CID 1234702, 1234703]
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 053c00b069..cd2df5ac34 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1201,6 +1201,10 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len,
tor_free(password);
connection_printf_to_buf(conn, "515 Authentication failed: %s\r\n", errstr);
connection_mark_for_close(TO_CONN(conn));
+ if (sl) { /* clean up */
+ SMARTLIST_FOREACH(sl, char *, cp, tor_free(cp));
+ smartlist_free(sl);
+ }
return 0;
ok:
log_info(LD_CONTROL, "Authenticated control connection ("TOR_SOCKET_T_FORMAT