]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
bugfix: make receiving csv lines not seg fault
authorRoger Dingledine <arma@torproject.org>
Tue, 17 Aug 2004 11:52:20 +0000 (11:52 +0000)
committerRoger Dingledine <arma@torproject.org>
Tue, 17 Aug 2004 11:52:20 +0000 (11:52 +0000)
svn:r2260

src/or/config.c

index 60f1a42c6fc84018edd7173ee9a0f4df50d377ee..27bb3faf03613b620a4140c29483d0b6712ad48b 100644 (file)
@@ -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