mirror of https://gerrit.osmocom.org/libosmocore
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
This commit is contained in:
parent
ad9757a3b1
commit
f083382b9c
|
@ -102,6 +102,8 @@ struct iofd_msghdr *iofd_msghdr_alloc(struct osmo_io_fd *iofd, enum iofd_msg_act
|
|||
talloc_free(hdr);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
talloc_steal(iofd->msgb_alloc.ctx, msg);
|
||||
}
|
||||
|
||||
hdr->action = action;
|
||||
|
|
Loading…
Reference in New Issue