From cb6ad70994dc7686f1c89d803fcca1081b5ef32b Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 22 Jul 2014 15:00:52 +0200 Subject: mgcp: Change API to remove memory management from the name Jacob pointed out that "free_endp" refers to the memory of the endpoint being freed. What we want is actually a way to release an endpoint (and the resource it allocated) or in the case of the testcase/testapp initialize the data structure correctly. Introduce two names for that. --- openbsc/tests/mgcp/mgcp_test.c | 7 +------ openbsc/tests/mgcp/mgcp_transcoding_test.c | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'openbsc/tests/mgcp') diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c index 5f3526650..50c8b2d0a 100644 --- a/openbsc/tests/mgcp/mgcp_test.c +++ b/openbsc/tests/mgcp/mgcp_test.c @@ -828,12 +828,7 @@ static void test_packet_error_detection(int patch_ssrc, int patch_ts) endp.tcfg = &trunk; - /* This doesn't free endp but resets/frees all fields of the structure - * and invokes mgcp_rtp_end_reset() for each mgcp_rtp_end. OTOH, it - * expects valid pointer fields (either NULL or talloc'ed), so the - * memset is still needed. It also requires that endp.tcfg and - * trunk.endpoints are set up properly. */ - mgcp_free_endp(&endp); + mgcp_initialize_endp(&endp); rtp->payload_type = 98; diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/openbsc/tests/mgcp/mgcp_transcoding_test.c index 2e857a13f..44f307251 100644 --- a/openbsc/tests/mgcp/mgcp_transcoding_test.c +++ b/openbsc/tests/mgcp/mgcp_transcoding_test.c @@ -180,7 +180,7 @@ static int given_configured_endpoint(int in_samples, int out_samples, tcfg->cfg = cfg; endp->tcfg = tcfg; endp->cfg = cfg; - mgcp_free_endp(endp); + mgcp_initialize_endp(endp); dst_end = &endp->bts_end; dst_end->payload_type = audio_name_to_type(dstfmt); -- cgit v1.2.3