From f0b06d82cd6f2a340db052a2fa2e559aa75f1fa8 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Tue, 13 Jan 2015 11:56:28 +0100 Subject: sgsn/test: Fix msgb freeing in mocked bssgp_tx_dl_ud Currently the mocked bssgp_tx_dl_ud function used for testing in sgsn_test.c does not free the msg as it is done by the original function. This leads to a msgb leak in the test. This patch fixes the test code accordingly and uncomments the assertion that checks for left-over msgbs. Sponsored-by: On-Waves ehf --- openbsc/tests/sgsn/sgsn_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbsc/tests') diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index ae7a715e2..ebe12c906 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -53,6 +53,7 @@ int bssgp_tx_dl_ud(struct msgb *msg, uint16_t pdu_lifetime, struct bssgp_dl_ud_par *dup) { sgsn_tx_counter += 1; + msgb_free(msg); return 0; } @@ -1463,8 +1464,7 @@ int main(int argc, char **argv) printf("Done\n"); talloc_report_full(tall_bsc_ctx, stderr); - /* TODO: The following check currently fails */ - /* OSMO_ASSERT(talloc_total_blocks(tall_msgb_ctx) == 1); */ + OSMO_ASSERT(talloc_total_blocks(tall_msgb_ctx) == 1); return 0; } -- cgit v1.2.3