aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/device.c4
1 files changed, 4 insertions, 0 deletions
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) {