From 45a04b715c017edee59329e5d2d3b85be8834c31 Mon Sep 17 00:00:00 2001 From: yagoda Date: Thu, 20 Apr 2023 11:25:07 +0200 Subject: [PATCH] e2ap: freeing heap allocated random object --- srsgnb/hdr/stack/ric/e2sm_kpm.h | 2 +- srsgnb/src/stack/ric/e2sm_kpm.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/srsgnb/hdr/stack/ric/e2sm_kpm.h b/srsgnb/hdr/stack/ric/e2sm_kpm.h index ba1d88d5b..77583ca08 100644 --- a/srsgnb/hdr/stack/ric/e2sm_kpm.h +++ b/srsgnb/hdr/stack/ric/e2sm_kpm.h @@ -35,7 +35,7 @@ public: static const uint32_t revision; e2sm_kpm(srslog::basic_logger& logger_, srsran::task_scheduler* _task_sched_ptr); - ~e2sm_kpm() = default; + ~e2sm_kpm(); virtual bool generate_ran_function_description(RANfunction_description& desc, ra_nfunction_item_s& ran_func); virtual bool process_ric_event_trigger_definition(ricsubscription_request_s subscription_request, diff --git a/srsgnb/src/stack/ric/e2sm_kpm.cc b/srsgnb/src/stack/ric/e2sm_kpm.cc index f9ab99b21..4d05700b3 100644 --- a/srsgnb/src/stack/ric/e2sm_kpm.cc +++ b/srsgnb/src/stack/ric/e2sm_kpm.cc @@ -49,6 +49,10 @@ e2sm_kpm::e2sm_kpm(srslog::basic_logger& logger_, srsran::task_scheduler* _task_ } } +e2sm_kpm::~e2sm_kpm() +{ + srsran_random_free(random_gen); +} bool e2sm_kpm::generate_ran_function_description(RANfunction_description& desc, ra_nfunction_item_s& ran_func) { desc.function_shortname = short_name;