From 8d7b10ef58a4fbb2b21d0411d1f420dd69b5987c Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 23 Jul 2010 19:43:12 +0800 Subject: nat: Clang reported two places with garbage data Initialize the variables to NULL to fix it. --- openbsc/src/nat/bsc_nat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index dd0f24015..826f28819 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -310,6 +310,10 @@ static void bsc_send_con_refuse(struct bsc_connection *bsc, payload = gsm48_create_loc_upd_rej(GSM48_REJECT_PLMN_NOT_ALLOWED); else if (con_type == NAT_CON_TYPE_CM_SERV_REQ) payload = gsm48_create_mm_serv_rej(GSM48_REJECT_PLMN_NOT_ALLOWED); + else { + LOGP(DNAT, LOGL_ERROR, "Unknown connection type: %d\n", con_type); + payload = NULL; + } /* * Some BSCs do not handle the payload inside a SCCP CREF msg @@ -379,7 +383,7 @@ send_refuse: static int forward_sccp_to_bts(struct bsc_msc_connection *msc_con, struct msgb *msg) { - struct sccp_connections *con; + struct sccp_connections *con = NULL; struct bsc_connection *bsc; struct bsc_nat_parsed *parsed; int proto; -- cgit v1.2.3