pespin has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/26/32126/1

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-MessageType: newchange

Reply via email to