osmux: fix access to uninitialized memory area in scheduled_tx_*_cb
mgcp_send() needs some initialized address when printing a log message.
Nothing really serious but let's calm down valgrind.
diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index c57df00..b554b35 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -210,7 +210,10 @@
static void scheduled_tx_net_cb(struct msgb *msg, void *data)
{
struct mgcp_endpoint *endp = data;
- struct sockaddr_in addr;
+ struct sockaddr_in addr = {
+ .sin_addr = endp->net_end.addr,
+ .sin_port = endp->net_end.rtp_port,
+ };
mgcp_send(endp, MGCP_DEST_NET, 1, &addr, (char *)msg->data, msg->len);
msgb_free(msg);
@@ -219,7 +222,10 @@
static void scheduled_tx_bts_cb(struct msgb *msg, void *data)
{
struct mgcp_endpoint *endp = data;
- struct sockaddr_in addr;
+ struct sockaddr_in addr = {
+ .sin_addr = endp->bts_end.addr,
+ .sin_port = endp->bts_end.rtp_port,
+ };
mgcp_send(endp, MGCP_DEST_BTS, 1, &addr, (char *)msg->data, msg->len);
msgb_free(msg);