daniel has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34098 ) Change subject: osmo_io: Ensure correct ownership of msgb when sending ...................................................................... osmo_io: Ensure correct ownership of msgb when sending Use talloc_steal() if a msg is passed in to osmo_io when sending. This avoids the message being free()d early in case the original parent is free()d. Change-Id: Ie36bd68a8bd63e67d76fb41996f8fdf99f51d96c --- M src/core/osmo_io.c 1 file changed, 15 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 37127c1..f9d04fd 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -102,6 +102,8 @@ talloc_free(hdr); return NULL; } + } else { + talloc_steal(iofd->msgb_alloc.ctx, msg); } hdr->action = action; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie36bd68a8bd63e67d76fb41996f8fdf99f51d96c Gerrit-Change-Number: 34098 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-MessageType: merged