pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/32126 )

Change subject: llc: Free allocated LLMEs when freeing main context
......................................................................

llc: Free allocated LLMEs when freeing main context

Change-Id: Ifb51a956d5a41f01184db4d453c64128db439f7c
---
M src/llc/llc.c
1 file changed, 20 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved




diff --git a/src/llc/llc.c b/src/llc/llc.c
index 1c572d6..2ad0228 100644
--- a/src/llc/llc.c
+++ b/src/llc/llc.c
@@ -121,6 +121,16 @@
        },
 };

+static void gprs_llc_ctx_free(void)
+{
+       struct gprs_llc_llme *llme;
+
+       while ((llme = llist_first_entry_or_null(&g_ctx->llme_list, struct 
gprs_llc_llme, list)))
+               gprs_llc_llme_free(llme);
+
+       talloc_free(g_ctx);
+}
+
 int osmo_gprs_llc_init(enum osmo_gprs_llc_location location, const char 
*cipher_plugin_path)
 {
        int rc;
@@ -132,7 +142,7 @@
        }

        if (g_ctx)
-               talloc_free(g_ctx);
+               gprs_llc_ctx_free();

        g_ctx = talloc_zero(NULL, struct gprs_llc_ctx);
        g_ctx->location = location;

--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/32126
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Ifb51a956d5a41f01184db4d453c64128db439f7c
Gerrit-Change-Number: 32126
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to