]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
test_hs_control: initialize pointers to NULL
authorNick Mathewson <nickm@torproject.org>
Mon, 12 Jul 2021 18:59:29 +0000 (14:59 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 12 Jul 2021 18:59:29 +0000 (14:59 -0400)
This is an attempt to fix CID 1486276, where coverity warns us that,
if the tests failed, we might free() an uninitialized pointer.

src/test/test_hs_control.c

index b036c5eada8f00f79f91b0258c1201c2d06c5b01..c32803b380f5429a3e989dc92b5ca94f8ffbee7b 100644 (file)
@@ -798,7 +798,7 @@ test_hs_control_add_onion_helper_add_service(void *arg)
   hs_service_ht *global_map;
   hs_port_config_t *portcfg;
   smartlist_t *portcfgs;
-  char *address_out_good, *address_out_bad;
+  char *address_out_good = NULL, *address_out_bad = NULL;
   hs_service_t *service_good = NULL;
   hs_service_t *service_bad = NULL;