diff --git a/lib/include/srslte/common/buffer_pool.h b/lib/include/srslte/common/buffer_pool.h index 75c56fc0e..0a87c0df1 100644 --- a/lib/include/srslte/common/buffer_pool.h +++ b/lib/include/srslte/common/buffer_pool.h @@ -183,7 +183,7 @@ public: } b->reset(); if (!pool->deallocate(b)) { - fprintf(stderr, "Error deallocating PDU: Addr=0x%lx not found in pool\n", (uint64_t) b); + printf("Error deallocating PDU: Addr=0x%lx not found in pool\n", (uint64_t) b); } b = NULL; } diff --git a/srsue/src/upper/nas.cc b/srsue/src/upper/nas.cc index 2e491b733..6efcfc9a6 100644 --- a/srsue/src/upper/nas.cc +++ b/srsue/src/upper/nas.cc @@ -250,7 +250,6 @@ bool nas::rrc_connect() { } } else { nas_log->error("Could not establish RRC connection\n"); - pool->deallocate(dedicatedInfoNAS); } return false; } diff --git a/srsue/src/upper/rrc.cc b/srsue/src/upper/rrc.cc index 66a7de33e..aa6cb831a 100644 --- a/srsue/src/upper/rrc.cc +++ b/srsue/src/upper/rrc.cc @@ -526,6 +526,12 @@ bool rrc::connection_request(LIBLTE_RRC_CON_REQ_EST_CAUSE_ENUM cause, } } + if (!ret) { + rrc_log->warning("Could not estblish connection. Deallocating dedicatedInfoNAS PDU\n"); + pool->deallocate(this->dedicatedInfoNAS); + this->dedicatedInfoNAS = NULL; + } + pthread_mutex_unlock(&mutex); return ret; }