summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-08-17 11:52:20 +0000
committerRoger Dingledine <arma@torproject.org>2004-08-17 11:52:20 +0000
commit0131d94a6c7759e0160b946aea2d341eb06dead3 (patch)
treedbe2c0782a88e98e934f677defece54638ad417a
parent6cf09a5dc00e6bec528565075be5924c86d9486c (diff)
downloadtor-0131d94a6c7759e0160b946aea2d341eb06dead3.tar.gz
tor-0131d94a6c7759e0160b946aea2d341eb06dead3.zip
bugfix: make receiving csv lines not seg fault
svn:r2260
-rw-r--r--src/or/config.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 60f1a42c6f..27bb3faf03 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -200,12 +200,9 @@ static int config_compare(struct config_line_t *c, const char *key, config_type_
*(double *)arg = atof(c->value);
break;
case CONFIG_TYPE_CSV:
- if (arg) {
- SMARTLIST_FOREACH((smartlist_t*)arg, char *, cp, tor_free(cp));
- smartlist_free((smartlist_t*)arg);
- }
- arg = smartlist_create();
- parse_csv_into_smartlist(arg, c->value);
+ if(*(smartlist_t**)arg == NULL)
+ *(smartlist_t**)arg = smartlist_create();
+ parse_csv_into_smartlist(*(smartlist_t**)arg, c->value);
break;
case CONFIG_TYPE_LINELIST:
/* Note: this reverses the order that the lines appear in. That's