Explorar o código

fix a seg fault on hup when FascistFirewall is defined

svn:r2294
Roger Dingledine %!s(int64=21) %!d(string=hai) anos
pai
achega
cf6159abb9
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      src/or/config.c

+ 3 - 2
src/or/config.c

@@ -548,6 +548,7 @@ static void free_options(or_options_t *options) {
   if (options->FirewallPorts) {
     SMARTLIST_FOREACH(options->FirewallPorts, char *, cp, tor_free(cp));
     smartlist_free(options->FirewallPorts);
+    options->FirewallPorts = NULL;
   }
 }
 
@@ -800,8 +801,8 @@ int getconfig(int argc, char **argv, or_options_t *options) {
 
   if(options->FascistFirewall && !options->FirewallPorts) {
     options->FirewallPorts = smartlist_create();
-    smartlist_add(options->FirewallPorts, "80");
-    smartlist_add(options->FirewallPorts, "443");
+    smartlist_add(options->FirewallPorts, tor_strdup("80"));
+    smartlist_add(options->FirewallPorts, tor_strdup("443"));
   }
   if(options->FirewallPorts) {
     SMARTLIST_FOREACH(options->FirewallPorts, const char *, cp,