We may end up touching the buffer after we have release()'d it,
which means it may have been recycled by the time we call
resetReaderIndex().
Move the release() call to after the check so we do not end up
releasing it prematurely.
Change-Id: I43156dbe2e6c53a552a322e7b5ea27f8da3873c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
promise.setFailure(future.getException());
}
- // Not needed anymore, release
- byteBufMsg.release();
-
//rescheduling message from queue after successfully sent
if (wasPending) {
byteBufMsg.resetReaderIndex();
pending.remove();
}
+
+ // Not needed anymore, release
+ byteBufMsg.release();
}
// Check pending queue and schedule next