summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Stoeckl <code@mstoeckl.com>2023-03-25 10:29:26 -0400
committerManuel Stoeckl <code@mstoeckl.com>2023-03-25 10:35:20 -0400
commit9070c4c527c906cb186588ca410d92d2f7f3c7ba (patch)
tree2236832081c131aa18c39eae7281ac926d41d174
parent60fb837e91ed50e7d490cbcd564d8b57b4bf78b5 (diff)
Fix a memory leak
This was introduced by a0f6bfa191f55b99e4ff68dd0063aa0c0e12dcbd incorrectly checking when to increase the value of cxs->last_confirmed_msgno. As a result, one of the two Waypipe processes would leak all the messages sent to the other process.
-rw-r--r--src/mainloop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mainloop.c b/src/mainloop.c
index 4f14379..a91a197 100644
--- a/src/mainloop.c
+++ b/src/mainloop.c
@@ -282,7 +282,7 @@ static int interpret_chanmsg(struct chan_msg_state *cmsg,
wp_debug("Received WMSG_ACK_NBLOCKS: remote recvd %u",
ackm->messages_received);
if (msgno_gt(ackm->messages_received,
- cxs->last_received_msgno)) {
+ cxs->last_confirmed_msgno)) {
cxs->last_confirmed_msgno = ackm->messages_received;
}
return 0;