diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-29 13:07:07 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-29 13:07:07 -0400 |
commit | 6e9d5fc4ec40136d173be680a85a9bfb9b99fea4 (patch) | |
tree | e113c7ad625610479b76de4175883ba53a00261f /src/test/test_hs_intropoint.c | |
parent | 68dfbd5ef433b830059baa08d48589518db05d22 (diff) | |
parent | a2e623f631a63f041f76b79e554b01bbf62748b8 (diff) | |
download | tor-6e9d5fc4ec40136d173be680a85a9bfb9b99fea4.tar.gz tor-6e9d5fc4ec40136d173be680a85a9bfb9b99fea4.zip |
Merge remote-tracking branch 'ahf-github/maint-0.3.2' into maint-0.3.2
Diffstat (limited to 'src/test/test_hs_intropoint.c')
-rw-r--r-- | src/test/test_hs_intropoint.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c index 0cae2de7e1..b2d2700f8b 100644 --- a/src/test/test_hs_intropoint.c +++ b/src/test/test_hs_intropoint.c @@ -43,6 +43,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); @@ -56,6 +60,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; } |