aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hs_intropoint.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-29 13:07:13 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-29 13:07:13 -0400
commit1f389dadd02e9a234ee1d1c316cdb6dcc2b25489 (patch)
tree5418624ad0a04859728e253c35a1cc88a6f9dc81 /src/test/test_hs_intropoint.c
parent7a47379f252b4d277df7c289f8a9d3160b50eee0 (diff)
parentd3ecb3a8d6d55575d4ab3f80fed5e2b2fdcc561a (diff)
downloadtor-1f389dadd02e9a234ee1d1c316cdb6dcc2b25489.tar.gz
tor-1f389dadd02e9a234ee1d1c316cdb6dcc2b25489.zip
Merge branch 'maint-0.3.4'
Diffstat (limited to 'src/test/test_hs_intropoint.c')
-rw-r--r--src/test/test_hs_intropoint.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c
index 843f39423b..2445a8fcf1 100644
--- a/src/test/test_hs_intropoint.c
+++ b/src/test/test_hs_intropoint.c
@@ -44,6 +44,10 @@ new_establish_intro_cell(const char *circ_nonce,
trn_cell_establish_intro_t *cell = NULL;
hs_service_intro_point_t *ip = NULL;
+ /* Ensure that *cell_out is NULL such that we can use to check if we need to
+ * free `cell` in case of an error. */
+ *cell_out = NULL;
+
/* Auth key pair is generated in the constructor so we are all set for
* using this IP object. */
ip = service_intro_point_new(NULL, 0);
@@ -57,6 +61,9 @@ new_establish_intro_cell(const char *circ_nonce,
*cell_out = cell;
done:
+ if (*cell_out == NULL)
+ trn_cell_establish_intro_free(cell);
+
service_intro_point_free(ip);
return cell_len;
}