[PATCH] osmocom-bb[master]: mobile: Fix memory leak when not using a LUA script

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Fri Feb 23 08:19:17 UTC 2018


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6845

to look at the new patch set (#2).

mobile: Fix memory leak when not using a LUA script

The primitives are still allocated and dispatched but there was
no script handler to delete them. Change the ownership to delete
it at the end of the dispatch.

Change-Id: I510af13bcbb46f73a0a289f26a4921cc90bd986a
Fixes: OS#2925
---
M src/host/layer23/src/mobile/primitives.c
M src/host/layer23/src/mobile/script_lua.c
2 files changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/45/6845/2

diff --git a/src/host/layer23/src/mobile/primitives.c b/src/host/layer23/src/mobile/primitives.c
index c3f28a5..2d3e4ad 100644
--- a/src/host/layer23/src/mobile/primitives.c
+++ b/src/host/layer23/src/mobile/primitives.c
@@ -107,6 +107,7 @@
 		if (intf->ms == ms)
 			intf->indication(intf, prim);
 	}
+	msgb_free(prim->hdr.msg);
 }
 
 void mobile_prim_ntfy_started(struct osmocom_ms *ms, bool started)
diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c
index 9b256d3..8d3064d 100644
--- a/src/host/layer23/src/mobile/script_lua.c
+++ b/src/host/layer23/src/mobile/script_lua.c
@@ -451,8 +451,6 @@
 	default:
 		LOGP(DLUA, LOGL_ERROR, "Unknown primitive: %d\n", OSMO_PRIM_HDR(&prim->hdr));
 	};
-
-	msgb_free(prim->hdr.msg);
 }
 
 /*

-- 
To view, visit https://gerrit.osmocom.org/6845
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I510af13bcbb46f73a0a289f26a4921cc90bd986a
Gerrit-PatchSet: 2
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: fixeria <axilirator at gmail.com>



More information about the gerrit-log mailing list