summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;