[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] bugfix: make receiving csv lines not seg fault



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	config.c 
Log Message:
bugfix: make receiving csv lines not seg fault


Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- config.c	17 Aug 2004 11:42:22 -0000	1.140
+++ config.c	17 Aug 2004 11:52:20 -0000	1.141
@@ -200,12 +200,9 @@
       *(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