]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make the pt/transports test not crash.
authorNick Mathewson <nickm@torproject.org>
Fri, 25 Nov 2011 21:54:06 +0000 (16:54 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 25 Nov 2011 21:54:06 +0000 (16:54 -0500)
src/or/transports.c
src/test/test_pt.c

index 5e96b39a32996926a5eedadaa5213797b2121e60..10155c44759976a6657ff9c4d158e11edee4e85d 100644 (file)
@@ -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. */
index f97b21fa0d3d44b59fca9513462b54a1153bb5e9..45f441106e491a507899bb1bb73cc62930ca7a05 100644 (file)
@@ -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();