Переглянути джерело

Merge remote-tracking branch 'dgoulet/bug23319_032_01'

Nick Mathewson 7 роки тому
батько
коміт
f9cd870f50
3 змінених файлів з 5 додано та 2 видалено
  1. 1 1
      src/or/hs_descriptor.c
  2. 2 0
      src/or/hs_descriptor.h
  3. 2 1
      src/test/test_hs_descriptor.c

+ 1 - 1
src/or/hs_descriptor.c

@@ -147,7 +147,7 @@ static token_rule_t hs_desc_intro_point_v3_token_table[] = {
 };
 
 /* Free the content of the plaintext section of a descriptor. */
-static void
+STATIC void
 desc_plaintext_data_free_contents(hs_desc_plaintext_data_t *desc)
 {
   if (!desc) {

+ 2 - 0
src/or/hs_descriptor.h

@@ -256,6 +256,8 @@ STATIC int desc_sig_is_valid(const char *b64_sig,
                              const char *encoded_desc, size_t encoded_len);
 STATIC size_t decode_superencrypted(const char *message, size_t message_len,
                                    uint8_t **encrypted_out);
+STATIC void desc_plaintext_data_free_contents(hs_desc_plaintext_data_t *desc);
+
 #endif /* HS_DESCRIPTOR_PRIVATE */
 
 #endif /* TOR_HS_DESCRIPTOR_H */

+ 2 - 1
src/test/test_hs_descriptor.c

@@ -581,7 +581,8 @@ test_decode_bad_signature(void *arg)
   expect_log_msg_containing("Malformed signature line. Rejecting.");
   teardown_capture_of_logs();
 
- done: ;
+ done:
+  desc_plaintext_data_free_contents(&desc_plaintext);
 }
 
 static void