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

[tor-commits] [tor/master] Make the pt/transports test not crash.



commit b1bd30c24c4d9ee1a760c0fb28e18bc597bb0df5
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Nov 25 16:54:06 2011 -0500

    Make the pt/transports test not crash.
---
 src/or/transports.c |    4 +---
 src/test/test_pt.c  |    2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/or/transports.c b/src/or/transports.c
index 5e96b39..10155c4 100644
--- a/src/or/transports.c
+++ b/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. */
diff --git a/src/test/test_pt.c b/src/test/test_pt.c
index f97b21f..45f4411 100644
--- a/src/test/test_pt.c
+++ b/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();
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits