Skip to content

Commit

Permalink
* FIX [nmq_mqtt] fix potential memleak of local conn_param
Browse files Browse the repository at this point in the history
  • Loading branch information
JaylinYu committed May 6, 2023
1 parent 1cde5b5 commit 7f31d19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sp/protocol/mqtt/nmq_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ nmq_close_unack_msg_cb(void *key, void *val)
nni_msg_free(msg);
}

// Flush lmq and conn_param
void
nano_nni_lmq_flush(nni_lmq *lmq, bool cp)
{
Expand Down Expand Up @@ -851,7 +852,7 @@ nano_pipe_close(void *arg)
if (nni_lmq_resize(&s->waitlmq,
nni_lmq_cap(&s->waitlmq) * 2) != 0) {
log_error("wait lmq resize failed.");
conn_param_clone(p->conn_param);
conn_param_free(p->conn_param);
nni_msg_free(msg);
}
}
Expand Down

0 comments on commit 7f31d19

Please sign in to comment.