[PATCH 12/13] tests: e1inp_ipa_*_test: fix leak of msgb in ->sign_link path

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/OpenBSC@lists.osmocom.org/.

pablo at gnumonks.org pablo at gnumonks.org
Thu Aug 23 22:45:01 UTC 2012


From: Pablo Neira Ayuso <pablo at gnumonks.org>

Fix a leak in the tests: The ->sign_link callback is reponsible
for releasing the msgb.
---
 tests/e1inp_ipa_bsc_test.c |    1 +
 tests/e1inp_ipa_bts_test.c |    1 +
 2 files changed, 2 insertions(+)

diff --git a/tests/e1inp_ipa_bsc_test.c b/tests/e1inp_ipa_bsc_test.c
index b447893..b2fb11c 100644
--- a/tests/e1inp_ipa_bsc_test.c
+++ b/tests/e1inp_ipa_bsc_test.c
@@ -191,6 +191,7 @@ static int sign_link(struct msgb *msg)
 		LOGP(DBSCTEST, LOGL_ERROR, "Unknown signallin message.\n");
 		break;
 	}
+	msgb_free(msg);
 	return ret;
 }
 
diff --git a/tests/e1inp_ipa_bts_test.c b/tests/e1inp_ipa_bts_test.c
index f885c5c..31aac95 100644
--- a/tests/e1inp_ipa_bts_test.c
+++ b/tests/e1inp_ipa_bts_test.c
@@ -151,6 +151,7 @@ static int sign_link(struct msgb *msg)
 		LOGP(DBTSTEST, LOGL_ERROR, "Unknown signalling message.\n");
 		break;
 	}
+	msgb_free(msg);
 	return ret;
 }
 
-- 
1.7.10.4





More information about the OpenBSC mailing list