diff options
| author | helanfeng <[email protected]> | 2024-11-11 15:39:59 +0800 |
|---|---|---|
| committer | helanfeng <[email protected]> | 2024-11-11 15:39:59 +0800 |
| commit | 1432bf0934ba8320f55c76c5e503e4a41b6fba6b (patch) | |
| tree | bd09bd6f7b1c743cac8827824c8eddef24b13d88 | |
| parent | 54f4f5ab1fc374fb33ba543c1de76e8068a99201 (diff) | |
fix test mem leakdev_dtls_decoder
| -rw-r--r-- | decoders/dtls/test/dtls_test.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/decoders/dtls/test/dtls_test.cpp b/decoders/dtls/test/dtls_test.cpp index 33490df..438dd34 100644 --- a/decoders/dtls/test/dtls_test.cpp +++ b/decoders/dtls/test/dtls_test.cpp @@ -110,12 +110,13 @@ TEST(dtls_decoder, dtls_try_assemble_fragments) dtls_parser_hello(NULL, &handshake_hs, &dtls_msg, NULL); EXPECT_EQ(dtls_msg.msg_type , DTLS_MSG_TYPE_CLIENT_HELLO); ASSERT_TRUE(dtls_msg.msg_content!=NULL); - struct dtls_handshake *hello_info=(struct dtls_handshake *)dtls_msg.msg_content; + struct dtls_handshake *dtls_hs=(struct dtls_handshake *)dtls_msg.msg_content; char sni_str[512]={0}; - memcpy(sni_str, hello_info->sni, hello_info->sni_sz); - sni_str[hello_info->sni_sz]='\0'; + memcpy(sni_str, dtls_hs->sni, dtls_hs->sni_sz); + sni_str[dtls_hs->sni_sz]='\0'; EXPECT_STREQ(sni_str, "localhost"); + if(dtls_hs->extensions!=NULL) utarray_free(dtls_hs->extensions); free(dtls_msg.msg_content); free(parse_ctx->fragments_head->fragment_content); free(parse_ctx->fragments_head); |
