bugfix:修复packet io内存泄漏
This commit is contained in:
@@ -46,9 +46,9 @@ struct tfe_cmsg* tfe_cmsg_init()
|
||||
|
||||
pthread_rwlock_init(&(cmsg->rwlock), NULL);
|
||||
|
||||
ATOMIC_ZERO(&cmsg->flag);
|
||||
ATOMIC_ZERO(&cmsg->ref);
|
||||
ATOMIC_INC(&cmsg->ref);
|
||||
ATOMIC_ZERO(&(cmsg->flag));
|
||||
ATOMIC_ZERO(&(cmsg->ref));
|
||||
ATOMIC_INC(&(cmsg->ref));
|
||||
return cmsg;
|
||||
}
|
||||
|
||||
@@ -261,6 +261,9 @@ int tfe_cmsg_deserialize(const unsigned char *data, uint16_t len, struct tfe_cms
|
||||
|
||||
cmsg = ALLOC(struct tfe_cmsg, 1);
|
||||
pthread_rwlock_init(&(cmsg->rwlock), NULL);
|
||||
ATOMIC_ZERO(&(cmsg->flag));
|
||||
ATOMIC_ZERO(&(cmsg->ref));
|
||||
ATOMIC_INC(&(cmsg->ref));
|
||||
offset = sizeof(struct tfe_cmsg_serialize_header);
|
||||
nr_tlvs = ntohs(header->nr_tlvs);
|
||||
for(int i = 0; i < nr_tlvs; i++)
|
||||
|
||||
Reference in New Issue
Block a user