diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-02-22 10:56:54 +0100 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2010-02-22 10:56:54 +0100 |
commit | dcf85eb158690354b5446bc8603460acc6f86f47 (patch) | |
tree | ffb451327e8dfb108ee0c09b233002fceb26d841 /src/or/control.c | |
parent | e391a497ecc5f6021bbf11c3749ec6425433c365 (diff) | |
download | tor-dcf85eb158690354b5446bc8603460acc6f86f47.tar.gz tor-dcf85eb158690354b5446bc8603460acc6f86f47.zip |
Fix a memory leak, found by coverity
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/or/control.c b/src/or/control.c index b8e07a0c84..40ad4a25e1 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -2100,16 +2100,18 @@ handle_control_extendcircuit(control_connection_t *conn, uint32_t len, if ((smartlist_len(args) == 1) || (smartlist_len(args) >= 2 && is_keyval_pair(smartlist_get(args, 1)))) { - // "EXTENDCIRCUIT 0" || EXTENDCIRCUIT 0 foo=bar" - circ = circuit_launch_by_router(intended_purpose, NULL, - CIRCLAUNCH_NEED_CAPACITY); - if (!circ) { - connection_write_str_to_buf("551 Couldn't start circuit\r\n", conn); - } else { - connection_printf_to_buf(conn, "250 EXTENDED %lu\r\n", - (unsigned long)circ->global_identifier); - } - goto done; + // "EXTENDCIRCUIT 0" || EXTENDCIRCUIT 0 foo=bar" + circ = circuit_launch_by_router(intended_purpose, NULL, + CIRCLAUNCH_NEED_CAPACITY); + if (!circ) { + connection_write_str_to_buf("551 Couldn't start circuit\r\n", conn); + } else { + connection_printf_to_buf(conn, "250 EXTENDED %lu\r\n", + (unsigned long)circ->global_identifier); + } + SMARTLIST_FOREACH(args, char *, cp, tor_free(cp)); + smartlist_free(args); + goto done; } // "EXTENDCIRCUIT 0 router1,router2" || // "EXTENDCIRCUIT 0 router1,router2 PURPOSE=foo" |