mgw: Use tall_mgw_ctx to allocate struct mgcp_config

Change-Id: Ib51f1066bb73da4472bd8967cc1b1c44e964e9e5
This commit is contained in:
Pau Espin Pedrol
2025-03-06 20:27:41 +01:00
committed by pespin
parent f63ef75d9f
commit 5ec1c13221
3 changed files with 6 additions and 2 deletions

View File

@@ -40,6 +40,8 @@
#include "mgcp_ratectr.h"
extern void *tall_mgw_ctx;
#define RTP_PORT_DEFAULT_RANGE_START 16002
#define RTP_PORT_DEFAULT_RANGE_END RTP_PORT_DEFAULT_RANGE_START + 64

View File

@@ -1505,7 +1505,7 @@ struct mgcp_config *mgcp_config_alloc(void)
* appropiate place! */
struct mgcp_config *cfg;
cfg = talloc_zero(NULL, struct mgcp_config);
cfg = talloc_zero(tall_mgw_ctx, struct mgcp_config);
if (!cfg) {
LOGP(DLMGCP, LOGL_FATAL, "Failed to allocate config.\n");
return NULL;

View File

@@ -43,6 +43,8 @@
#include <math.h>
#include <ctype.h>
void *tall_mgw_ctx;
char *strline_r(char *str, char **saveptr);
const char *strline_test_data =
@@ -2323,7 +2325,7 @@ void test_conn_id_matching(void)
INIT_LLIST_HEAD(&endp.conns);
conn = talloc_zero(NULL, struct mgcp_conn);
conn = talloc_zero(tall_mgw_ctx, struct mgcp_conn);
OSMO_ASSERT(conn);
osmo_strlcpy(conn->id, conn_id_generated, sizeof(conn->id));
llist_add(&conn->entry, &endp.conns);