]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use tor_malloc_zero() in pt tests
authorNick Mathewson <nickm@torproject.org>
Thu, 11 Sep 2014 13:17:13 +0000 (09:17 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 11 Sep 2014 13:17:13 +0000 (09:17 -0400)
Fixes for PT tests merged with 8402; patch from Yawning.

src/test/test_pt.c

index b45151e8b7228c203b78fd799fa0ab6eb0592993..05ba24e65ae458600449975dd5e6b0a98e489dcc 100644 (file)
@@ -33,7 +33,7 @@ test_pt_parsing(void)
   transport_t *transport = NULL;
   tor_addr_t test_addr;
 
-  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_INFANT;
   mp->transports = smartlist_new();
 
@@ -363,7 +363,7 @@ test_pt_configure_proxy(void *arg)
 
   control_testing_set_global_event_mask(EVENT_TRANSPORT_LAUNCHED);
 
-  mp = tor_malloc(sizeof(managed_proxy_t));
+  mp = tor_malloc_zero(sizeof(managed_proxy_t));
   mp->conf_state = PT_PROTO_ACCEPTING_METHODS;
   mp->transports = smartlist_new();
   mp->transports_to_launch = smartlist_new();