Fix a bug that might have caused the leak, but which might have been hiding other bugs.

svn:r1026
This commit is contained in:
Nick Mathewson
2004-01-30 20:59:15 +00:00
parent 8e2bdc9e5a
commit 0cc83e066b
+5 -4
View File
@@ -695,7 +695,7 @@ routerinfo_t *router_get_entry_from_string(const char**s) {
return NULL;
}
NEXT_TOKEN();
NEXT_TOKEN(); /* XXX This leaks some arguments. */
if (tok->tp != K_ROUTER) {
log_fn(LOG_WARN,"Entry does not start with \"router\"");
@@ -807,7 +807,7 @@ routerinfo_t *router_get_entry_from_string(const char**s) {
NEXT_TOKEN();
while (tok->tp == K_ACCEPT || tok->tp == K_REJECT) {
router_add_exit_policy(router, tok);
NEXT_TOKEN();
NEXT_TOKEN(); /* This also leaks some args. XXX */
}
if (tok->tp != K_ROUTER_SIGNATURE) {
@@ -1067,11 +1067,12 @@ _router_get_next_token(const char **s, directory_token_t *tok) {
char *signature = NULL;
int i, done;
/* Clear the token _first_, so that we can clear it safely. */
router_release_token(tok);
tok->tp = _ERR;
tok->val.error = "";
router_release_token(tok);
*s = eat_whitespace(*s);
if (!**s) {
tok->tp = _EOF;