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.
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
index e13827b..4a0aaff 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
@@ -251,7 +251,7 @@
for (i = 1; i < nat->mgcp_cfg->trunk.number_endpoints; ++i){
bsc_mgcp_free_endpoint(nat, i);
- mgcp_free_endp(&nat->mgcp_cfg->trunk.endpoints[i]);
+ mgcp_release_endp(&nat->mgcp_cfg->trunk.endpoints[i]);
}
}
@@ -621,7 +621,7 @@
}
bsc_mgcp_free_endpoint(bsc->nat, ENDPOINT_NUMBER(endp));
- mgcp_free_endp(endp);
+ mgcp_release_endp(endp);
}
/*
@@ -1065,6 +1065,6 @@
rate_ctr_inc(ctr);
bsc_mgcp_free_endpoint(bsc->nat, i);
- mgcp_free_endp(&bsc->nat->mgcp_cfg->trunk.endpoints[i]);
+ mgcp_release_endp(&bsc->nat->mgcp_cfg->trunk.endpoints[i]);
}
}