handle byte buffer allocation error in s1ap

This commit is contained in:
Francisco Paisana 2021-02-12 19:11:30 +00:00
parent 4152e43bab
commit 929b8650a3
1 changed files with 5 additions and 1 deletions

View File

@ -1744,7 +1744,11 @@ bool s1ap::ue::send_ho_required(uint32_t target_eci,
// pack Transparent Container into HORequired message
srslte::unique_byte_buffer_t buffer = srslte::make_byte_buffer();
asn1::bit_ref bref(buffer->msg, buffer->get_tailroom());
if (buffer == nullptr) {
logger.error("Failed to allocate buffer for HORequired message packing");
return false;
}
asn1::bit_ref bref(buffer->msg, buffer->get_tailroom());
if (transparent_cntr.pack(bref) != asn1::SRSASN_SUCCESS) {
logger.error("Failed to pack transparent container of HO Required message");
return false;