Attention is currently required from: neels, pespin. dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/31016 )
Change subject: fix possible leak of ue_context on UE REGISTER error ......................................................................
Patch Set 1: Code-Review+1
(2 comments)
File src/osmo-hnbgw/hnbgw_hnbap.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/31016/comment/2cf3d465_4ec80082 PS1, Line 335: ue = ue_allocated = ue_context_alloc(hnb, NULL, tmsi);
what's the point in having 2 different variables here? I see no benefit and added complexity.
Probably to distinguish later that the ue was locally allocated rather than pulled from the context using ui_context_by_tmsi?
https://gerrit.osmocom.org/c/osmo-hnbgw/+/31016/comment/a333592b_59579475 PS1, Line 345: ue_context_free(ue_allocated); here: what if hnbap_encode_uregisteraccpties() failes, when the context was from ue_context_by_tmsi() then we keep it when we allocated it above, then we free it.