Skip to content

Commit

Permalink
* FIX [proto/quic] Fix the double free of msg in recv_aio.
Browse files Browse the repository at this point in the history
Signed-off-by: wanghaemq <wangwei@emqx.io>
  • Loading branch information
wanghaEMQ committed May 11, 2024
1 parent c3b043d commit 17f620e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/mqtt/protocol/mqtt/mqtt_quic_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,10 @@ mqtt_quic_recv_cb(void *arg)
nni_atomic_get_bool(&p->closed)) {
// pipe is already closed somewhere
// free msg and dont return data when pipe is closed.
msg = nni_aio_get_msg(&p->recv_aio);
if (msg) {
nni_msg_free(msg);
}
//msg = nni_aio_get_msg(&p->recv_aio);
//if (msg) {
// nni_msg_free(msg);
//}
nni_mtx_unlock(&p->lk);
return;
}
Expand Down
8 changes: 4 additions & 4 deletions src/mqtt/protocol/mqtt/mqttv5_quic_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,10 +705,10 @@ mqtt_quic_recv_cb(void *arg)
nni_atomic_get_bool(&p->closed)) {
// pipe is already closed somewhere
// free msg and dont return data when pipe is closed.
msg = nni_aio_get_msg(&p->recv_aio);
if (msg) {
nni_msg_free(msg);
}
//msg = nni_aio_get_msg(&p->recv_aio);
//if (msg) {
// nni_msg_free(msg);
//}
nni_mtx_unlock(&p->lk);
return;
}
Expand Down

0 comments on commit 17f620e

Please sign in to comment.