Procházet zdrojové kódy

Make the pt/transports test not crash.

Nick Mathewson před 12 roky
rodič
revize
b1bd30c24c
2 změnil soubory, kde provedl 2 přidání a 4 odebrání
  1. 1 3
      src/or/transports.c
  2. 1 1
      src/test/test_pt.c

+ 1 - 3
src/or/transports.c

@@ -699,9 +699,7 @@ handle_proxy_line(const char *line, managed_proxy_t *mp)
  err:
   mp->conf_state = PT_PROTO_BROKEN;
   log_warn(LD_CONFIG, "Managed proxy at '%s' failed the configuration protocol"
-           " and will be destroyed.", mp->argv[0]);
-
-  return;
+           " and will be destroyed.", mp->argv ? mp->argv[0] : "");
 }
 
 /** Parses an ENV-ERROR <b>line</b> and warns the user accordingly. */

+ 1 - 1
src/test/test_pt.c

@@ -91,7 +91,7 @@ test_pt_protocol(void)
 {
   char line[200];
 
-  managed_proxy_t *mp = tor_malloc(sizeof(managed_proxy_t));
+  managed_proxy_t *mp = tor_malloc_zero(sizeof(managed_proxy_t));
   mp->conf_state = PT_PROTO_LAUNCHED;
   mp->transports = smartlist_create();