summaryrefslogtreecommitdiff
path: root/src/or/hs_intropoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/hs_intropoint.c')
-rw-r--r--src/or/hs_intropoint.c16
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));
+}
+