summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2021-09-06 14:31:09 +0800
committerliuxueli <[email protected]>2021-09-11 19:15:13 +0800
commitd5488fcc51c1b612198282bbbe9c9a480b6da463 (patch)
treec3c054e2d71df20fad7d8f748cdb1bcf5bf6bc09 /src
parent175026ce16ec1af06fe8ebdb28378f81139155ed (diff)
修复使用tcmalloc时报错的问题v2.0.6
Diffstat (limited to 'src')
-rw-r--r--src/HTTP_Message.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/HTTP_Message.c b/src/HTTP_Message.c
index 22d3cff..30f2f3f 100644
--- a/src/HTTP_Message.c
+++ b/src/HTTP_Message.c
@@ -284,7 +284,11 @@ int http_readMainConf(const char* filename)
void http_proto_tag_free(int thread_seq, void *value)
{
- free(value);
+ if(value!=NULL)
+ {
+ dictator_free(thread_seq, value);
+ value=NULL;
+ }
return;
}
@@ -294,13 +298,13 @@ int http_add_proto_tag(int projetc_id, struct streaminfo *a_stream, const char*
struct http_proto_tag_t* proto_tag = (struct http_proto_tag_t*)project_req_get_struct(a_stream,projetc_id);
if(proto_tag == NULL)
{
- proto_tag = (struct http_proto_tag_t *)calloc(sizeof(struct http_proto_tag_t), 1);
+ proto_tag = (struct http_proto_tag_t *)dictator_malloc(a_stream->threadnum, sizeof(struct http_proto_tag_t));
if(0 != project_req_add_struct(a_stream, projetc_id, proto_tag))
{
- free(proto_tag);
+ dictator_free(a_stream->threadnum, proto_tag);
return -1;
}
- }
+ }
memcpy(proto_tag->buf, value, len);
proto_tag->buf[len]='\0';
return 0;