diff --git a/ChangeLog b/ChangeLog index 8cc1883ef4..73eb78707c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -137,6 +137,7 @@ Changes in version 0.1.2.5-alpha - 2007-01-03 if their identity keys are as expected. - When the user uses bad syntax in the Log config line, stop suggesting other bad syntax as a replacement. + - Avoid a double-free when parsing malformed DirServer lines. o Controller features: - Have GETINFO dir/status/* work on hosts with DirPort disabled. diff --git a/src/or/config.c b/src/or/config.c index 1f8335e482..19e1a302b7 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3385,6 +3385,7 @@ parse_dir_server_line(const char *line, int validate_only) goto err; } addrport = smartlist_get(items, 0); + smartlist_del_keeporder(items, 0); if (parse_addr_port(LOG_WARN, addrport, &address, NULL, &dir_port)<0) { log_warn(LD_CONFIG, "Error parsing DirServer address '%s'", addrport); goto err; @@ -3393,7 +3394,6 @@ parse_dir_server_line(const char *line, int validate_only) log_warn(LD_CONFIG, "Missing port in DirServer address '%s'",addrport); goto err; } - smartlist_del_keeporder(items, 0); fingerprint = smartlist_join_strings(items, "", 0, NULL); if (strlen(fingerprint) != HEX_DIGEST_LEN) {