From 2f66b99830e6dc731e4f631ea743771df701659e Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 29 Dec 2021 19:47:55 -0800 Subject: Fix leak of messages lost during device abort. --- src/core/device.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core/device.c') diff --git a/src/core/device.c b/src/core/device.c index c7266271..08c7bab5 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -78,6 +78,10 @@ device_cb(void *arg) if ((rv = nni_aio_result(&p->aio)) != 0) { nni_mtx_lock(&device_mtx); + if (p->state == NNI_DEVICE_STATE_SEND) { + nni_msg_free(nni_aio_get_msg(&p->aio)); + nni_aio_set_msg(&p->aio, NULL); + } p->state = NNI_DEVICE_STATE_FINI; d->running--; if (d->rv == 0) { -- cgit v1.2.3-70-g09d2