mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 15:10:48 +01:00
test: Fix memory leak in hs_descriptor/decode_bad_signature
Fixes #23319 Cherry-picked from master; bug not in any released Tor.
This commit is contained in:
parent
2d55620a9e
commit
7eaf055b28
3 changed files with 5 additions and 2 deletions
|
@ -167,7 +167,7 @@ desc_intro_point_free(hs_desc_intro_point_t *ip)
|
|||
}
|
||||
|
||||
/* 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) {
|
||||
|
|
|
@ -235,6 +235,8 @@ STATIC int desc_sig_is_valid(const char *b64_sig,
|
|||
STATIC void desc_intro_point_free(hs_desc_intro_point_t *ip);
|
||||
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 */
|
||||
|
|
|
@ -574,7 +574,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
|
||||
|
|
Loading…
Add table
Reference in a new issue