summaryrefslogtreecommitdiff
path: root/src/quic_process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quic_process.cpp')
-rw-r--r--src/quic_process.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/quic_process.cpp b/src/quic_process.cpp
index 4b677c6..076001e 100644
--- a/src/quic_process.cpp
+++ b/src/quic_process.cpp
@@ -100,6 +100,12 @@ static int copy_extension_tag(const char *tag_start_pos, int tag_len, char **out
{
if(tag_start_pos!=NULL && tag_len>0)
{
+ if(*out!=NULL)
+ {
+ dictator_free(thread_seq, *out);
+ *out=NULL;
+ }
+
(*out)=(char *)dictator_malloc(thread_seq, tag_len+1);
memcpy(*out, tag_start_pos, tag_len);
(*out)[tag_len]='\0';
@@ -310,9 +316,12 @@ int parse_special_frame_stream(struct quic_info* quic_info, const char *payload,
return PARSE_RESULT_VERSION;
}
- quic_info->client_hello=(struct quic_client_hello *)dictator_malloc(thread_seq, sizeof(struct quic_client_hello));
- memset(quic_info->client_hello, 0, sizeof(struct quic_client_hello));
-
+ if(quic_info->client_hello==NULL)
+ {
+ quic_info->client_hello=(struct quic_client_hello *)dictator_malloc(thread_seq, sizeof(struct quic_client_hello));
+ memset(quic_info->client_hello, 0, sizeof(struct quic_client_hello));
+ }
+
tag_value_start_offset=payload_offset+tag_num*4*2; // skip length of type and offset, type(offset)=szieof(int)
while(tag_num>pass_tag_num)