Skip to content

Commit

Permalink
NAS/RRC memory leak fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aligungr committed Dec 24, 2021
1 parent 7bc0d09 commit 132d7a3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/nas/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace nas

struct InformationElement
{
virtual ~InformationElement() = default;
};

struct InformationElement1 : InformationElement
Expand Down
3 changes: 3 additions & 0 deletions src/lib/nas/msg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ struct NasMessage

protected:
NasMessage() = default;

public:
virtual ~NasMessage() = default;
};

struct SmMessage : NasMessage
Expand Down
1 change: 1 addition & 0 deletions src/ue/rrc/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ void UeRrcTask::receiveRrcSetup(int cellId, const ASN_RRC_RRCSetup &msg)

m_initialNasPdu = {};
sendRrcMessage(pdu);
asn::Free(asn_DEF_ASN_RRC_UL_DCCH_Message, pdu);

m_logger->info("RRC connection established");
switchState(ERrcState::RRC_CONNECTED);
Expand Down
1 change: 1 addition & 0 deletions src/ue/rrc/nas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void UeRrcTask::deliverUplinkNas(uint32_t pduId, OctetString &&nasPdu)
asn::SetOctetString(*c1.choice.ulInformationTransfer->dedicatedNAS_Message, nasPdu);

sendRrcMessage(pdu);
asn::Free(asn_DEF_ASN_RRC_UL_DCCH_Message, pdu);
}

void UeRrcTask::receiveDownlinkInformationTransfer(const ASN_RRC_DLInformationTransfer &msg)
Expand Down

0 comments on commit 132d7a3

Please sign in to comment.