diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-08-08 20:31:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-08 20:31:57 -0400 |
commit | 34e4122025791d1a607426e5e543d6312872b9dd (patch) | |
tree | 975c1dc949d81ed7a76f50726a49d4aa8e67533e /src/or/hs_intropoint.c | |
parent | 649104fdb950057288a5e7b48f402d563546b83b (diff) | |
parent | 2f17743d6f7222cf96250890dd91d6689b2d55c6 (diff) | |
download | tor-34e4122025791d1a607426e5e543d6312872b9dd.tar.gz tor-34e4122025791d1a607426e5e543d6312872b9dd.zip |
Merge branch 'ticket20657_nickm_bugfixes_squashed'
Diffstat (limited to 'src/or/hs_intropoint.c')
-rw-r--r-- | src/or/hs_intropoint.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/or/hs_intropoint.c b/src/or/hs_intropoint.c index 636b345b5b..cb4d6c02e5 100644 --- a/src/or/hs_intropoint.c +++ b/src/or/hs_intropoint.c @@ -24,6 +24,7 @@ #include "hs/cell_introduce1.h" #include "hs_circuitmap.h" +#include "hs_descriptor.h" #include "hs_intropoint.h" #include "hs_common.h" @@ -591,3 +592,18 @@ hs_intro_received_introduce1(or_circuit_t *circ, const uint8_t *request, return -1; } +/* Clear memory allocated by the given intropoint object ip (but don't free the + * object itself). */ +void +hs_intropoint_clear(hs_intropoint_t *ip) +{ + if (ip == NULL) { + return; + } + tor_cert_free(ip->auth_key_cert); + SMARTLIST_FOREACH(ip->link_specifiers, hs_desc_link_specifier_t *, ls, + hs_desc_link_specifier_free(ls)); + smartlist_free(ip->link_specifiers); + memset(ip, 0, sizeof(hs_intropoint_t)); +} + |